Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
Django static files do not resolve constant 404 errors

I am new to Django current version I'm running is 1.11 with python 3. I have configured the static file stuff as the docs suggest. Inside installed apps I have 'django.contrib.staticfiles'

nonprofit/nonprofit/settings.py

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'
STATICFILES_DIR = (
    os.path.join(BASE_DIR, "static/"),
)

And django seems to be working as far as putting the right path in the template. Though even if I hardcode the path into the template the browser still gives a 404 not found.

I have a base.html template, with some css.

{% load staticfiles %}
<!--Bootstrap-->
<link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
<link rel="stylesheet" href="/static/css/bootstrap-theme.css">

My directory structure is --

nonprofit
  - goals
  - nonprofit
  - static
    - css
      bootstrap.css
      bootstrap-theme.css
  - templates
      base.html
  db.sqlite3
  manage.py

From the browser it shows both 404 not found errors as well as not being able to go straight to the files-

GET http://127.0.0.1:8000/static/css/bootstrap.css 127.0.0.1/:19 
GET http://127.0.0.1:8000/static/css/bootstrap-theme.css 127.0.0.1/:20

I don't think the problem is with django because it shows the right path, but even the hardcoded one cannot be accessed through the browser. I'm running the development server. Whats going on with this stuff? Do I have something wrongly configured or lacking configuration? Any help is appreciated. I have looked at all the suggested posts and have tried various things without any good results.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The setting name is STATICFILES_DIRS. You are missing the S.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!