Use the same static file in multiple applications in Django

My Django project is divided into several applications, and static files are stored in each application as follows:

/Project /foo /static /css /style.css /views.py /models.py /urls.py /bar /static /css /style.css /views.py /models.py /urls.py /urls.py /manage.py /settings.py 

But I'm not sure how to use the same static files in multiple applications.

+6
source share
1 answer

This is why the STATICFILES_DIRS parameter is STATICFILES_DIRS :

Your project will probably also have static assets that are not tied to a specific application. The STATICFILES_DIRS parameter is a tuple of file system directories that must be checked when loading static files. This is a search path that is empty by default.

+5
source

Source: https://habr.com/ru/post/912716/


All Articles