Reputation: 1133
I'm using a Django-SSLServer add-on with my Django app. As found at: here
For some reason when I run the server (using PyCharm), my static content doesn't render properly (if at all!). However, when I run the built in HTTP server, it renders the static files fine.
How can I re-route my site so that static works for HTTPS? I'm using the built in server with Django.
Thanks!
Upvotes: 2
Views: 1134
Reputation: 1948
Within your urls.py you should map your static path ie:
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
or alternatively,
from django.conf import settings
...
(r'^static/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.STATIC_DOC_ROOT}),
This should render your settings files while DEBUG=False
Hope this helps!
Upvotes: 1