By chefvillas
I have my django installed properly with all the gunicorn, nginx and systemd collaborating with each other, I can see the Congratulations page you have successfully installed django etc. Yet, it says that my debug at settings.py file is set to True, which is not.
Also I have created a hello world page at views.py and urls.py and it says page not found. when I go mywebsite.com/home I am inside my virtualenvironment because it is there where I installed everything, of course.
from django.http import HttpResponse
def home(request): return HttpResponse(‘hello’)
and the urls.py
from django.contrib import admin from django.urls import path from myapp import views
urlpatterns = [ path(‘admin/’, admin.site.urls), path(‘home/’,views.home, name=‘home’), ]
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I found the answer on Stackoverflow
https://stackoverflow.com/questions/38617046/django-debug-false-still-runs-in-debug-mode/51153638
As a note for others: I had the same problem; I configured my production website on a VM with gunicorn and nginx, following the tutorial for ubuntu 16.04 from the digital ocean documentation.
I wasn’t able to turn off the debug mode, even when restarting the nginx systemd’s service: the solution was to restart also the gunicorn service:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.