Sunday, August 30, 2015

Re: Is there a way to make the template process {{ MEDIA_URL }} if it is stored in a model field.

On Aug 30, 2015, at 2:37 PM, Christophe Pettus <xof@thebuild.com> wrote:

> On Aug 30, 2015, at 12:43 PM, Dennis Marwood <dennismarwood@gmail.com> wrote:
>
>> How do I get the template to treat {{ }} in my entry as a variable?
>
> The Django template language doesn't iterate over the results of expansion; once a substitution is done, it moves on. So, template language constructs that "appear" in the result due to variable expansion.

As a note, this is a feature, not a bug: If template expansion iterated like that, it would be a serious security hole, since someone could drop template items ( {{ entry.delete }}, anyone?) into user-edited content.

--
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+unsubscribe@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/7995C1A8-4DAB-4E59-B661-325D93A8E9AB%40thebuild.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment