Django - 500 INTERNAL SERVER ERROR
For django v 1.5+ , in your settings.py file, Make the configuration ALLOWED_HOSTS = ['*'] if you want a quick fix
If you are really going production (and concerned about security), put allowed host names in ALLOWED_HOSTS
This SO link has more info
Setting DEBUG = False causes 500 Error
Comments
-
Eric Sauer over 1 year
What I am currently trying to do is to create a Error 404 page on my Django Server. In order to see the Error 404 page, you must turn django's debugging to off. So when I change it to "DEBUG = False" I am able to see my webpage and see the Error 404 page when going to a page that is not on the server. I went back to my main page and with Firebug realized that I was getting a
NetworkError: 500 INTERNAL SERVER ERROR
It is preventing me to pull data from Django. However, when I change "DEBUG = False" to "DEBUG = True". Everything works.
Any Clue?
edit: Full error
"NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/ext-4.0.2a/resources/css/ext-all.css"
edit edit: So I was kinda reserved with what I posted on error side. I'll take a look at the static serving however this is the full error
"NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/ext-4.0.2a/resources/css/ext- "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/ext-4.0.2a/bootstrap.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/example-data.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/StatusBar.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/LiveSearchGridPanel.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/frontend.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/InspectHostPanel.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/InspectGuestPanel.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/StatusBar.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/LiveSearchGridPanel.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/frontend.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/InspectHostPanel.js" "NetworkError: 500 INTERNAL SERVER ERROR - http://localhost:8000/static/InspectGuestPanel.js"
So its not with one certain class it an issue of not being able to pull from Django. Personally it looks like Its try to pull from the web server rather than the folders.
-
agf over 12 yearsDid you look at the logs? The console output?
-
Eric Sauer over 12 yearsYeah Im getting something like "[02/Aug/2011 15:02:35] "GET /p HTTP/1.1" 500 305 [02/Aug/2011 15:02:36] "GET /static/ext-4.0.2a/resources/css/ext-all.css" Thats in purple
-
John over 12 yearsHow are you serving the static content?
-
Chris Morgan over 12 years@Eric: you can also try looking at /static/ext-4.0.2a/resources/css/ext-all.css with DEBUG = True
-
James Khoury over 12 yearsWhats your urls.py file look like? I'm betting you have a
if DEBUG:
line in it for your static files. -
Brandon Taylor over 12 yearsI second @James on this. I typically make a separate setting: SERVE_STATIC_MEDIA that I can use independently of DEBUG for that very reason.
-
James Khoury over 12 years@brandon when i run without debug i usually am running in apache or some such webserver wich i configure to handle for me. something similar to : docs.djangoproject.com/en/dev/howto/deployment/modwsgi
-
Brandon Taylor over 12 yearsYes, I do the same. Often during dev on my local box, I'll need to work with those values independently, but I never, ever serve statics through Django in production :)
-
Eric Sauer over 12 yearsAlright, I think if figured it out... The Debug == False screws it up... almost got it to work
-