56👍
✅
It’s looking for a folder named ‘static’ that’s next to the settings.py, i.e. in the project folder, not at the root of the git repo.
git root/
git root/{app name}
git root/{app name}/settings.py
git root/{app name}/static/ <- this is what you're missing
Note that empty folders aren’t tracked by git, so you’ll have to put a blank file in there if it’s empty. Alternatively, remove the STATICFILES_DIRS
setting until you need it.
17👍
I just had this same problem, and here’s the solution that worked for me:
I changed:
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
to:
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'myappfolder/static'),
)
- [Django]-How to change empty_label for modelForm choice field?
- [Django]-Django admin and showing thumbnail images
- [Django]-Django: How do I add arbitrary html attributes to input fields on a form?
1👍
@joerick’s answer above is the thing. However, if you do not want to place another ‘static’ folder (git root/{your app}/static), you might consider changing the BASE_DIR variable that is initially supplied by django-admin makeproject:
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
which is just the (git root/) directory
👤Dima
- [Django]-Django Query __isnull=True or = None
- [Django]-Django admin: can I define fields order?
- [Django]-Python regex for integer?
Source:stackexchange.com