11👍
EDIT: It seems that the OP mispelled the STATICFILES_DIRS
setting, missing an ‘S’.
Within your Django app directory create a subdirectory static
and then within that directory, create another one named the same as the name of your Django app. Then move your css
directory inside that latest mentioned directory.
So, something like this:
- your_django_app
-- static
--- your_django_app
---- css
----- bootstrap.min.css
Then you’ll be able to use in your templates like this:
<link rel="stylesheet" href="{% static 'your_django_app/css/bootstrap.min.css' %}">
2👍
As per @bonidjkic’s comment: I believe that you misspelled the STATICFILES_DIRS setting (you're missing an 'S')
, this was the problem.
Thank you ever so much, I feel so stupid as to how I had ever missed that.
- Django – When should I use signals and when should I override save method?
- Copying ManyToMany fields from one model instance to another
- How can I access an uploaded file in universal-newline mode?
- Is it OK to print to stdout or stderr in Django data migrations? If so, how?
- How to set value of a ManyToMany field in Django?
1👍
on the setting.py file try using this syntax:
STATICFILES_DIRS = [
os.path.join (BASE_DIR, “static”),
‘/ Var / www / static /’,
]
0👍
Do you need the “STATICFILES_DIR” variable in your case? It points to the same place so it’s redundant until you run it on something like nginx or Apache I would think, to have them server the static files.
Is django.contrib.staticfiles in you “INSTALLED_APPS” variable in your settings file?
- Initial Data for Django Inline Formsets
- Django – How to show messages under ajax function
- How can I get the Django admin's "View on site" link to work?