In my current project, css file only load on one page and in other pages don't load at all. According to steps described in this topic, i configured static directory and in first page of my application it works fine, but in other pages dont work. In my project i have some template based web page and some html pages. First page of my project is html page. here is my settings.py file:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = (
os.path.join(BASE_DIR, '../Contract_Assistant/RuleManager/static/'),
os.path.join(BASE_DIR, '../Contract_Assistant/ExpertSystem/static/'),
os.path.join(BASE_DIR, 'static'),
and my static directory defined as:
/home/SocialAI/Contract_Assistant/static
and my css file is in root of static directory and also in application static specified directory as above. Also i load static files in first page as below:
<!DOCTYPE html>
<html>
<title>تنظیمات سیستم</title>
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
and in other pages as:
{% extends "base.html" %}
{% block title_html %}
لیست قوانین
{% endblock %}
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}">
Whats the problem now?
this is my web page [address].2