B
B
bigtrouble2015-11-10 11:22:48
Django
bigtrouble, 2015-11-10 11:22:48

Is it possible to connect all statics by template?

Good afternoon, is it possible to connect all the statics in Django somehow?
{% static "css/vendor/*.css" %}
Or maybe there is an iterator to run through a given folder and connect everything? I know for sure this is implemented in Symfony

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Kitaev, 2015-11-10
@bigtrouble

If such a desire appeared, then your users will suffer. Lots of CSS/js files are wrong. All your (custom project) styles should be in one file. And it is also desirable to collect all CSS in one file (if there is a bootstrap, font awesome, etc.). This is what django-compressor does. What's so hard about importing a couple of files into base.HTML once and then inheriting from it?

Z
zelsky, 2015-11-10
@zelsky

And why is it bad to select blocks? {% block staticfiles %}
And include . Although, like most, just insert everything in the inherited template {% static '/css/test.css'%}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question