django gunicorn static file not found

Solutions on MaxInterview for django gunicorn static file not found by the best coders in the world

showing results for - "django gunicorn static file not found"
Cassandre
23 Jan 2019
1#All You need is dj-static package
2pip install dj-static
3
4#Configure your static assets in settings.py:
5STATIC_ROOT = 'staticfiles'
6STATIC_URL = '/static/
7
8#Then, update your wsgi.py file to use dj-static
9from django.core.wsgi import get_wsgi_application
10from dj_static import Cling
11
12application = Cling(get_wsgi_application())
13
14#Add to Your urls.py
15from django.contrib.staticfiles.urls import staticfiles_urlpatterns
16#after urlpatterns=[]
17urlpatterns += staticfiles_urlpatterns()