Hi,

I want to embedding css- and js-files for seperate templates.

I have an django-project with project/static/css/base.css. In the base.html

<snip>

    <!DOCTYPE html>
    <html>
    {% load static %}

</snap>

and in the base.css

<snip>


header {
  background-color: #F8F8F8;
}

</snap>

In my settings.py

<snip>


STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static")
]


STATIC_URL = '/static/'
</snap>

It does what it should do. Changing the base.css-file is displaying. Fine.

Now I extend an app with the directories project/app/static/css and
project/app/static/js and in the subdirectory css I put a app.css in it
and for testing I write there

<snip>

header {
  background-color: #888888;
}

</snap>

In the html-template I write:

<snip>

{% extends 'base.html' %}
{% block content %}
{{ form.media }}
{% load crispy_forms_tags %}
{% load static %}
<script src="{% static 'app/js/app.js' %}"></script>
<link rel="stylesheet" type="text/css" href="{% static 'app/css/app.css'
%}">

</snap>

It doesn't work. :(

My understanding was that django work first the general.css (here
base.css) and the app-specific-css-files so in this case the
background-color will be overwritten. Is this correct?

Anybody know where are my mistakes?

Thanks and Greetings

bengoshi




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9dbf7d0a-9360-2418-b801-ac13f56b77ad%40gmail.com.

Reply via email to