In my Django 1.10 app static files work fine with DEBUG = True but aren't served with DEBUG = False Why? In settings.py I have:
urls.py contains
html includes the following
asked 28 Oct '16, 14:55 nickw |
It appears you don't have the static files app being served by your website entry. Please have a look at the documentation here. answered 28 Oct '16, 15:14 bmeyer71 ♦♦ I've read through that documentation more than once, although that's not to say I understood it all correctly. I have got the django.contrib.staticfiles app listed in myproject’s INSTALLED_APPS setting - is that what you meant?
(28 Oct '16, 17:44)
nickw
No. You need to create the static app to collect the files to then mount that application as described. eg: /static
(28 Oct '16, 17:51)
bmeyer71 ♦♦
I've done: python3.5 manage.py collectstatic, to collect the static files over at my static media app and restarted the django app, but still no static files are served. When you say mount the app as described that's what I've done with the STATIC_URL and STATIC_ROOT settings I think.
(28 Oct '16, 19:09)
nickw
The mounting of the app needs to be done in the control panel under the website entry. That is different than your settings.py
(28 Oct '16, 19:15)
bmeyer71 ♦♦
Wow, I really thought I'd done that, but it seems I hadn't... Thank you so much!
(28 Oct '16, 19:49)
nickw
|