I am trying to add a css file to my Django app, eventually in production but right now I can't even get it to run the local server using runserver
. Whenever I load the page that should use the css file, I get the error "GET /static/ldap/style.css HTTP/1.1" 404 1666
, with some variation on the filepath and error code, as I have tried a whole lot of combinations. Some other errors that I have gotten are
"GET /static/style.css HTTP/1.1" 404 1651
Not Found: /ldap/style.css
[12/Jun/2018 15:07:07] "GET /ldap/style.css HTTP/1.1" 404 2804
My current setup is attempting to copy the official docs from the tutorial and the suggested doc in the settings.py file. I have:
in my settings.py:
STATIC_URL = '/static/'
,
in my search.html:
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'ldap/style.css' %}">
And the file structure of my project root folder is thus (I am trying to implement this in the ldap application, to be clear):
├── conf
├── db.sqlite3
├── djangoWrapper
│ ├── __init__.py
│ ├── __pycache__
│ ├── settings.py
│ ├── templates
│ │ └── djangoWrapper
│ │ └── index.html
│ ├── urls.py
│ ├── views.py
│ └── wsgi.py
├── ldap
│ ├── admin.py
│ ├── apps.py
│ ├── forms.py
│ ├── __init__.py
│ ├── migrations
│ ├── models.py
│ ├── static
│ │ └── ldap
│ │ └── style.css
│ ├── templates
│ │ └── ldap
│ │ ├── apiOffline.html
│ │ ├── index.html
│ │ ├── results.html
│ │ └── search.html
│ ├── tests.py
│ ├── urls.py
│ └── views.py
├── manage.py
├── openshift
├── README.md
├── requirements.txt
├── runserver.sh
└── static
└── admin
Are there any good ideas about what might be the problem here? I have tried following a lot of other related posts (like this) but none of them have worked, which might be related to the fact that none of them had the same error code (404 1666 and 404 1651) that I am having. I can give more information upon request, any help is appreciated. Thank you.