[ Prev ] [ Index ] [ Next ]

Configuration

Created Dienstag 03 März 2020


settings.py

Include django.contrib.staticfiles in INSTALLED_APPS. -> By default included.
Add STATIC_URL = '<relative path to static files on a web server>'

-> E.g. STATIC_URL = '/static/'



Global files

Add to settings.py:

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "<relativedir name for static files>"),
    '<absolut dir name for static files>',
]

-> This uses STATICFILES_FINDERS. Desciption for STATICFILES_DIRS.


Attention

Do not create app directories in this dierctories. This are global and not specific to an app. (my advice)