Re: Load a static file with a variable name

2015-10-07 Thread Simon Charette
You'll want to use 



Because François' suggestion will break if you use a static file storage 
that doesn't
allow missing files reference such as the ManifestStaticFilesStorage 

.

Simon

Le mardi 6 octobre 2015 14:40:01 UTC-4, François Schiettecatte a écrit :
>
> The '+' is an error, the line look more like this:
>
>  />
>
> On Tue, Oct 6, 2015 at 2:33 PM, I. Dié  
> wrote:
>
>> I tried in your way to concatenate, I don't get any exception, but  the 
>> image image does'nt want to display. The plage only throw the "alt" value. 
>> Even for this line of code it's thing.
>>
>>
>> Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>>>
>>> Try this:
>>>
>>> >> pet.name }} />
>>>
>>> You're embedding {{pet_name}} in a string. If this was a regular Python 
>>> statement, it would be like writing "Hello, {0}" and not having a format() 
>>> at the end.
>>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6cca59fe-4a35-4dfc-bfac-5b2e722e8f02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load a static file with a variable name

2015-10-07 Thread I . Dié
Thank you very much monsieur François 

Le mardi 6 octobre 2015 20:40:01 UTC+2, François Schiettecatte a écrit :
>
> The '+' is an error, the line look more like this:
>
>  />
>
> On Tue, Oct 6, 2015 at 2:33 PM, I. Dié  
> wrote:
>
>> I tried in your way to concatenate, I don't get any exception, but  the 
>> image image does'nt want to display. The plage only throw the "alt" value. 
>> Even for this line of code it's thing.
>>
>>
>> Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>>>
>>> Try this:
>>>
>>> >> pet.name }} />
>>>
>>> You're embedding {{pet_name}} in a string. If this was a regular Python 
>>> statement, it would be like writing "Hello, {0}" and not having a format() 
>>> at the end.
>>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ca812bda-3eff-49fa-b4ab-db10b9d1101b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load a static file with a variable name

2015-10-06 Thread François Schiettecatte
The '+' is an error, the line look more like this:



On Tue, Oct 6, 2015 at 2:33 PM, I. Dié  wrote:

> I tried in your way to concatenate, I don't get any exception, but  the
> image image does'nt want to display. The plage only throw the "alt" value.
> Even for this line of code it's thing.
>
>
> Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>>
>> Try this:
>>
>> > pet.name }} />
>>
>> You're embedding {{pet_name}} in a string. If this was a regular Python
>> statement, it would be like writing "Hello, {0}" and not having a format()
>> at the end.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOhTVJEUZO_EQAoKSb-iSAEMumgc0StGctVYP55RxJoDXUYxww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load a static file with a variable name

2015-10-06 Thread I . Dié
I tried in your way to concatenate, I don't get any exception, but  the 
image image does'nt want to display. The plage only throw the "alt" value. 
Even for this line of code it's thing.


Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>
> Try this:
>
>  pet.name }} />
>
> You're embedding {{pet_name}} in a string. If this was a regular Python 
> statement, it would be like writing "Hello, {0}" and not having a format() 
> at the end.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Load a static file with a variable name

2015-10-06 Thread Shawn Milochik
 Try this:



You're embedding {{pet_name}} in a string. If this was a regular Python
statement, it would be like writing "Hello, {0}" and not having a format()
at the end.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOzwKwE5Cgd379M93%3DYb46_3-%2B0%3DFdYUigojycOgpi14OxAJ0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Load a static file with a variable name

2015-10-06 Thread I . Dié
Hi everybody,

I want to load a image with a variable name   in  detail.html like this:

{% load staticfiles %}


the image won't load. But when I try this way, it's work perfectly:

{% load staticfiles %}


Here is my question How to load a static file with a variable name? Ps: 
pet.name value is always the image's name for each pet.

best regards

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/83297d6e-98a8-4add-96a2-f742e4b423d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.