Reputation: 418
I have deployed my Django project on Ubuntu and I forgot to set the Debug to False till the very end, now I have pulled the last commit to the server with the debug set to False. So now when I try to access a non existing url, for example, it should display my custom 404.html template.
Instead it displays the Debug mode 404 error instead telling me that Debug = True even if it's not, I checked the settings.py file on the server and Debug is set to False.
I tried restarting nginx and supervisor with service nginx restart
and supervisorctl restart my_app_name
but when I enter a non existing url it still says that Debug is set to True.
Why does it still say that Debug is set to True?
UPDATE: following the answer received I went over the possible issues proposed and found none of them. Furthermore, when I run the exact same project on the local machine it works just fine with Debug = False.
If I run on the server the SAME EXACT project, with the same exact code and files/file structure (they are "synchronized" with github) it shows that the Debug is set to True, so there must be something related to the configuration on the server.
SECOND UPDATE: after adding a new domain in the ALLOWED_HOSTS
list of the settings.py file, it is disregarding that as well. So it's not just a problem of the DEBUG variable, it is disregarding every change made to the settings.py file.
Could it be Cloudfare Caching? If yes, what's a way to prevent this?
Upvotes: 1
Views: 1013
Reputation:
Because it is. Common causes:
local_settings.py
is imported and that has DEBUG=TrueDEBUG = 'False' # this is True
Upvotes: 1