I would be against adding this. Most text editors support a
find-and-replace with regex option that would let you capture the asset
path and place it within the {% static '' %} tag; additionally, you could
always change your templates to include STATIC_URL globally and just do
{{ STATIC_URL }} if you wanted to avoid using the static tag with the path
to the asset.

On Sun, 20 Jan 2019 at 17:47, Mohammad Etemaddar <
mohammad.etemad...@gmail.com> wrote:

> in the conversion of HTML template to Django template, sometimes it is
> hard to find&remplce static paths.
> In current Django template we should change for example this:
>
> <link rel="stylesheet" href="css/w3.css">
> to
> <link rel="stylesheet" href="{% static 'css/w3.css' %}">
>
> as you see we add two parts to the href:
>
> <link rel="stylesheet" href="*{% static '*css/w3.css*' %}*">
>
> We can also do in this order:
>
>
> (2) <link rel="stylesheet" href="*{% static '**' %}*css/w3.css">
>
> In this way, we need to do only one find/replace. But in the previous way,
> we should first do find/replace on beginning and then add "%}" to the end.
> Maybe with some find/replace on every suffix (jpg,jpeg,css,js,png...)
> But in way (2) We need only one find/replace if we have one asset
> directory in template.
> In this way, We can give the static function default value blank in order
> to put just *{% static %}*.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/b891d179-a6da-4150-8ebd-a966e5af9567%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/b891d179-a6da-4150-8ebd-a966e5af9567%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2ffNLrD-ARSnwDdMms6__RU1MJ-q2V09SDpPVheO%3DBAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to