1

During development I had DEBUG = True and I got debug tracings. Then I switched to DEBUG = False for testing the 404 / 500 pages.

Now, after I switched back to DEBUG = True I get no tracings, only "Internal Server Error" message.

How do I get those debug tracings back?

Thanks Martin Weberg

3
  • 2
    if you are running apache for example, you will need to reload it to see the changes in source code. Commented Sep 16, 2011 at 9:48
  • What is your server config like? (apache, nginx, etc?) or are you just using the built-in runserver? Either way you'll need to stop your server and start it again. I had an issue with using a restart command instead of stop/start and code in the settings.py was not updating Commented Sep 16, 2011 at 21:15
  • Sorry all of you... I did a search for "debug = False" in my projects folder and found it a second time further down in the settings.py file. Thank you all for the time you spent... Commented Sep 19, 2011 at 11:44

6 Answers 6

3

How are you checking that DEBUG is set to True? Try

python manage.py shell

At the python prompt enter

from django.conf import settings

settings.DEBUG

what is the result?

If it is False then Debug maybe getting reset in perhaps a local_settings.py file (or some other place). Then do a grep -r "DEBUG = False" * from the project directory.

If the result for settings.DEBUG was True, then either apache is loading the wrong wsgi, or wsgi is loading the wrong settings.py file.

Which settings.py file is wsgi using?

Sign up to request clarification or add additional context in comments.

2 Comments

I found a second "debug = False" further down in the settings.py .... Thank you for pushing me in the right direction.
import settings is not the good way to import settings, use instead from django.conf import settings
1

first check DEBUG setting from

$ python manage.py shell
In [1]: from django.conf import settings

In [2]: settings.DEBUG
Out[2]: True

django.conf.settings abstracts the concepts of default settings and site-specific settings; it presents a single interface. It also decouples the code that uses settings from the location of your settings. Docs

Comments

0

try to enter invalid path. If 404.html will apear it means that somewhere DEBUG is still set to False, or like Uku Loskit wrote you have to reload server

EDIT:

  1. Run django built-in server and see the results
  2. print DEBUG at the end of settings.py

1 Comment

Now I double checked. DEBUG = True I restarted Apache. Now when I enter an invalid URL i get the 404.html message. Ideas?
0

Give a chance to The Python Debugger, it is really simple, just import it and write pdb.set_trace() in the line you want to start debugging.

Comments

0

You can check the DEBUG setting by doing:

python manage.py shell
import settings
print settings.DEBUG

Comments

0

If you have verified DEBUG is True at runtime and this is still happening, ensure you have not set DEBUG_PROPAGATE_EXCEPTIONS This setting will cause you to not see debug tracebacks in the browser.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.