P
P
Pavel2018-03-05 10:56:49
Flask
Pavel, 2018-03-05 10:56:49

Flask blueprint how to properly distribute static?

Good afternoon.
I want to store template and static in each blueprint, but I want to distribute from the general static. I am using flask-webassets
Structure
app
--- blueprint_name
------ template
------ static
--------- js
--- static
------ js
----- ---- gen
------------ blueprint_name
in template:

{% assets filters="jsmin", output="js/gen/blueprint_name/script.js", "blueprint_name/js/script.js" %}
        <script type="text/javascript" src="{{ ASSET_URL }}"></script>

As a result, it generates
<script type="text/javascript" src="/blueprint_name/static/js/script.js"></script>

Why is output ignored?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2018-03-06
@toobinks

Everything turned out to be simple - in DEBUG, static is derived from the blueprint, and in the release from the general static.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question