2👍
✅
Perhaps you’re missing the STATICFILES_DIRS
setting.
When in production, python manage.py collectstatic
moves all static files inside STATIC_ROOT
directory so nginx
can look up here for them, however in dev mode, django needs to know where the static files are, and use STATICFILES_DIRS
tuple for that.
If you have these files inside exam/static, your STATICFILES_DIRS
should looks like:
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
1👍
If you are using ./manage runserver then you’re missing STATICFILES_DIRS.
For nginx/gunicorn http://nginx.com/resources/admin-guide/serving-static-content/. Also Django White Noise
- [Django]-Django sort the query elements in a weekly monthly daily fashion
- [Django]-How to read data, apply a function and return the result with Django REST Framework?
- [Django]-Get the first element in the for loops in the Django template
- [Django]-Django models.Manager unable to access model
Source:stackexchange.com