Tuesday, July 2, 2019

order of loading css-files

Hi:

I tried to load bootstrap and an own css-file. But in which order does django load it?

I have tried in my base.html:

<!DOCTYPE html>  <html>  {% load static %}  <head>          <link rel='stylesheet' href="{% static 'bootstrap/css/site.css' %}">      <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">        <link rel="stylesheet" href="{% static 'css/base.css' %}">        <title>{% block title %}gyousei{% endblock title %}</title>      </head>  ...    and the log is writing:    [02/Jul/2019 11:54:38] "GET / HTTP/1.1" 200 6259  [02/Jul/2019 11:54:38] "GET /static/css/base.css HTTP/1.1" 304 0  [02/Jul/2019 11:54:38] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690  [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 1702  [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690  [02/Jul/2019 11:54:38] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690    and if I write       <!DOCTYPE html>  <html>  {% load static %}  <head>        <link rel="stylesheet" href="{% static 'css/base.css' %}">        <link rel='stylesheet' href="{% static 'bootstrap/css/site.css' %}">      <link rel="stylesheet" href="{% static 'bootstrap/css/bootstrap.min.css' %}">          <title>{% block title %}gyousei{% endblock title %}</title>      </head>  ...    the log writes    [02/Jul/2019 11:54:11] "GET /static/css/base.css HTTP/1.1" 304 0  [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/jquery.min.js HTTP/1.1" 404 1702  [02/Jul/2019 11:54:11] "GET /static/bootstrap/js/popper.js HTTP/1.1" 404 1690  [02/Jul/2019 11:54:11] "GET /static/bootstrap/css/site.css HTTP/1.1" 404 1690    If I understand it correct in both cases django loads my base.css first so bootstrap overwrites it.  How can I change this?    Thanks for your response,    bengoshi  
--   herz-jesu-jugend.de

No comments:

Post a Comment