I had proglem with .css file loaded to template

12 visualizzazioni
Passa al primo messaggio da leggere

Dariusz Mysior

da leggere,
21 nov 2015, 08:21:3621/11/15
a Django users

I have a problem with loading the css file, after calling index.html who inherits base_ownsite.html which reads css page will not show background color or font color ...

base_ownsite.html

{% load staticfiles %} <!DOCTYPE html> <html lang="en"> <head> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" type="text/css" href="{% static 'ownsite/css /style.css' %}" /> </head> <body> {% block content %} {% endblock %} </body> </html>

index.html

{% extends 'ownsite/base_ownsite.html' %} {% block content %} {% if user.is_authenticated %} <p>Jesteś zalogowany <a href='accounts/my_view'>{{ user.username }}</a></p> <p><a href='/accounts/logout_view'>wyloguj</a></p> {% else %} <h2>Strona główna</h2> <a href='/accounts/login_view'>logowanie</a> <a href='/accounts/register_user'>rejestracja</a> {% endif %} {% endblock %}



style.css




 body
{
 background
: yellow;
}

h2
{
 color
: red;
}

p
{
 color
: yellow;
 
}

settings.py

STATIC_URL = '/static/'

 STATICFILES_DIRS
= (
 
"/ownsite/static",
)

Dariusz Mysior

da leggere,
21 nov 2015, 08:28:1421/11/15
a Django users
And also when I change path to app css file

accounts - style.css

body {
    background
-color: green;
}

h2
{
    color
: blue;
}

in page details code I had

body {
    background
: red ;
}

h2
{
    color
: blue;
}

with was set a long time ago, now I set green background but page is red :/

Dariusz Mysior

da leggere,
21 nov 2015, 11:59:0021/11/15
a Django users
Ok it's ok already, but I don't know how :/

thanks!


W dniu sobota, 21 listopada 2015 14:21:36 UTC+1 użytkownik Dariusz Mysior napisał:
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi