Re: static templatetag: adding default argument blank

2019-01-20 Thread Mohammad Etemaddar
You are right. This is a better option, {{ STATIC_URL }}.
Mohammad Etemaddar

*  in   *
Programming services: *Python* & *Linux*



On Sun, Jan 20, 2019 at 9:46 PM Adam Johnson  wrote:

> 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:
>>
>> 
>> to
>> 
>>
>> as you see we add two parts to the href:
>>
>> 
>>
>> We can also do in this order:
>>
>>
>> (2) 
>>
>> 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
>> 
>> .
>> 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.
>

-- 
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/CALJt1nvTy5x6DDUuf2pC-KOwxoR5kh8jADzLv%3DrfgPF6W2j6dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: static templatetag: adding default argument blank

2019-01-20 Thread Adam Johnson
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:
>
> 
> to
> 
>
> as you see we add two parts to the href:
>
> 
>
> We can also do in this order:
>
>
> (2) 
>
> 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
> 
> .
> 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.