dev version of tutorial part 3 -
Customizing Error Views
The 404 (page not found) view
The suggested code works as expected though I have some quibbles about documentation wording.
BUT...
When in settings.py DEBUG= True, django prints the stack trace plus a note advising that this view is displayed because DEBUG is set to True.
In settings.py, I see:
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
Makes sense, besides I have created a 404.html and put it in the right place, and I want to see it displayed
When I Set DEBUG=False, I then get "Server Error (500)" not 404.
With some experimentation, I discovered that if I set DEBUG=False the tutorial app appears to always fail with Server Error 500. As a test, I went back to tutorial part 1. created a new minimal project, confirmed that it worked, then set DEBUG=False. and voila I get Server Error (500) again.
That is:
- DEBUG = True, in debug mode - the code works without error
- DEBUG = False, in production mode - the code fails Server Error (500)
Aside from my setting DEBUG to False, this is all django generated code.
I am a django newbie, but this feels like a bug.
Checking the IRC archives I see more than one question about cryptic Server Error (500) occurrences.
Comments?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment