I am ready to deploy my Django application, and I noticed that when I change the "DEBUG" parameter to False, all links to static files (like JavaScript, CSS, etc.) lead to errors HTTP 500.
HTTP 500
Any idea what causes this problem (and how to fix it)?
I would highly recommend that your web server handle static requests before reaching Django. In mine, urls.pyI only add a static request handler if the debug parameter is set to True.
urls.py
Technically, Django serving static work works fine. Definitely read the short docs page, http://docs.djangoproject.com/en/dev/howto/static-files/ . You will want to use this entry inurls.py
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/path/to/media'})
, Django. http://docs.djangoproject.com/en/dev/howto/deployment/ /howtos http://docs.djangoproject.com/en/dev/howto/static-files/ , ( ).
, , . , 500 - 404 , 500 , Django 404.html. , , 500, .
URL- . DEBUG False, URL- "/" , , DEBUG = True, Django "/" , . , , , . .
, SECRET_KEY. . .
SECRET_KEY