I'm using Django==1.5.5
and My django app is structured as
--project/
----project/
------settings.py
------urls.py
----app1/
------models.py
------views.py
----staticfiles/
------style.css
----static/
------admin/
--------js/
--------css/
------style.css
----templates/
------header.html
------post.html
------footer.html
----manage.py
the /project/settings.py
is
import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '..')
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
MEDIA_ROOT = ''
MEDIA_URL = ''
SITE_ROOT = PROJECT_ROOT
STATIC_ROOT = os.path.join(SITE_ROOT, 'static')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(SITE_ROOT, 'staticfiles'),
)
TEMPLATE_DIRS = (
os.path.join(SITE_ROOT, 'templates'),
)
in header.html
i trying use it as:
<head>
<title>My Site</title>
{% load static from staticfiles %}
<link rel="stylesheet" href="{% static 'style.css' %}">
</head>
But its not loading mysite.com/static/style.css
and giving error 404
I ran python manage.py collectstatic
to collect all static file.
Why its loading css file? any configuration missing?
Please suggest.