[Fixed]-Django Cannot find static/css files error 404


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' %}">


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.


on the setting.py file try using this syntax:

os.path.join (BASE_DIR, “static”),
‘/ Var / www / static /’,


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?

Leave a comment