Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django gunicorn static file not found

#All You need is dj-static package
pip install dj-static

#Configure your static assets in settings.py:
STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/

#Then, update your wsgi.py file to use dj-static
from django.core.wsgi import get_wsgi_application
from dj_static import Cling

application = Cling(get_wsgi_application())

#Add to Your urls.py
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
#after urlpatterns=[]
urlpatterns += staticfiles_urlpatterns()
Comment

PREVIOUS NEXT
Code Example
Python :: python how to install numpy on pycharm 
Python :: view point cloud open3d 
Python :: python find which os 
Python :: fetch python 
Python :: reverse linked list with python 
Python :: install biopython in windows 
Python :: fake migration 
Python :: scipy rfft 
Python :: django import settings variables 
Python :: python number with comma to float 
Python :: python get size of file 
Python :: python parse json file 
Python :: python remove during iteration 
Python :: object.image.url email template django 
Python :: cv2.GaussianBlur() 
Python :: how to find largest number in array in python 
Python :: start new app in django 
Python :: middle value of a list in python 
Python :: code for making an exe file for python 
Python :: random number pythn 
Python :: Extract Date from Datetime object 
Python :: python save input to text file 
Python :: append to csv python 
Python :: python search string for word 
Python :: next day in python without using datetime 
Python :: Resource punkt not found. Please use the NLTK Downloader to obtain the resource: 
Python :: pandas read csv unnamed 0 
Python :: django queryset group by sum 
Python :: while loop countdown python 
Python :: python remove duplicates from a list 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =