1

So I have two apps (account and job). Each app has its own respective app_name/templates/app_name and app_name/static/app_name directories.

With the following static related settings:

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

I can use app-specific templates and static files with no problem. I.e. in my job/templates/index.html I have the line

 <link rel="stylesheet" href="{% static 'job/index.css' %}">` 

and it grabbed the job/static/job/index.css file.

However, under the main project directory(website/) I have a website/templates/base.html( in other answers on here I have seen this where you should store base.html) and a website/static/css/base.css file . I cannot get this base.css file to load. Within base.html I have tried the following three links:

    <link rel="stylesheet" href="{% static 'base.css' %}">
   `<link rel="stylesheet" href="{% static 'css/base.css' %}">
    <link rel="stylesheet" href="{% static 'static/css/base.css' %}">

and none of them have worked. Does anyone know how to get this base.css working? Thanks in advance and yes I included {% load static %} and have ran collectstatic.

Update: When I click 'source' in chrome dev tools I see the following directory layout:

static/
  css/
    base.css ("Could not find the original style sheet.")
  job/
    index.css (working without a problem)

also when I navigate directly to http://127.0.0.1:8000/static/css/base.css I get a page not found(404) error.

Justin
  • 1,329
  • 3
  • 16
  • 25

0 Answers0