Issue
I have django project.
In my development, when error happens like not import modules... etc.
It shows the error on the browser, but I don't want to show that in production.
Where can I switch off the debug mode???
Solution
The settings.py
file has a DEBUG
setting [Django-doc]. You will furthermore need to specify the ALLOWED_HOSTS
setting [Django-doc]. You can set this to False
:
# settings.py
# …
DEBUG = False
ALLOWED_HOSTS = ['www.mywebsite.com']
# …
Note that some tooling of Django is not done when you work in a production environment, like serving static files. You will need to configure nginx/apache/… for that. For more information, see the Deploying static files section in the documentation.
Answered By - willeM_ Van Onsem
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.