I have these settings in settings.py:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.ManifestStaticFilesStorage'
I've run collectstatic
and there are files in /static/app/js
directory:
jquery-3.2.1.min.c9f5aeeca3ad.js
jquery-3.2.1.min.js
I'm just using Django's runserver to test this at the moment.
If I run with DEBUG = True, everything works, as the JS is fetched from /static/app/js/jquery-3.2.1.min.js
If I run with DEBUG = False, all static files fail with 404. The JS URL is now /static/app/js/jquery-3.2.1.min.c9f5aeeca3ad.js
The URL looks correct, the files exist, what could be causing this to fail?
My view includes:
{% load static %}
<script src="{% static 'app/js/jquery-3.2.1.min.js' %}"></script>
Am I missing a setting?
(using Django 1.11, Python 3.6)