1๐
โ
You can store your static files in multiple folders which can reside anywhere
It will look like this in settings
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
#You can have multiple directories here
)
Set the STATIC_ROOT like this in settings
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
When you run $ python manage.py collectstatic
This will copy all files from your static folders into the STATIC_ROOT directory.
The purpose of this to gather all static files in a single directory so you can serve them easily.
**Note
Set the base directory in settings
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
๐คvasudokala
0๐
Basically what you have to do, is to tell django STATICFILES_DIR settings where all your static folder live
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static'),
os.path.join(BASE_DIR, 'mycssfolder'),
os.path.join(BASE_DIR, 'otherstaticfolder')
]
so when you run djangoadmin collecstatic command it looks into all those folder for static files.
๐คpitaside
- Django โ change form field to readonly when value in view is set to any value
- How to solve the error with migration django?
- Django : Heroku deploy Error 500 on app pages but admin working
Source:stackexchange.com