[Answered ]-Receiving 404 error when trying to load static urls directly in Django

1👍

Short answer

Django does not serve STATIC_ROOT on STATIC_URL, unless you tell it too.

Long answer

This should be a FAQ, here’s an article about using django.contrib.staticfiles right (disclamer: written by me, feedback appreciated). It’s like the documentation but tries to be shorter and more pragmatic.

👤jpic

1👍

use <link rel="stylesheet" href="{{ STATIC_URL }}css/site_base.css" /> instead of

<link href="{%static 'css/style.css'%}" rel="stylesheet"> and make sure your value is
STATIC_URL = '/static/' in the settings.py

Leave a comment