Static File Settings
Setting STATIC_ROOT
is one of the configurations that can often create an error as the mechanism of statics file handling is often incorrectly understood.
Static file locations
Django is designed to let a web server or a reverse proxy server (e.g., Nginx) handle static files directly in the production environment. By this configuration, the Django app can focus more on the dynamic part.
Development Stage
When DEBUG
is True
, Django considers that the app is running still under the development environment, and the development server (runserver) gets the static files from the original locations. The locations are specified through the STATICFILES_DIRS
settings. You can list multiple locations. Usually, there are two types of locations. One is directly under the project file. The other is und
Subscribe now for
uninterrupted access.