Here's a write-up on doing this with a context processor:
http://www.b-list.org/weblog/2006/06/14/django-tips-template-context-processors

On Mar 2, 10:45 pm, "ashwoods" <[EMAIL PROTECTED]> wrote:
> context processor would be better :) its just included in the context,
> while here you are "parsing" text.
>
> On Mar 3, 3:16 am, "Henrik Lied" <[EMAIL PROTECTED]> wrote:
>
> > Hi there, Sean!
>
> > Thanks for the different methods --
>
> > I went for a different approach, though. I simply created a simple
> > filter like this:
> > def mediaurl(value):
> >     import re
> >     from project.setting import MEDIA_URL
> >     "Replaces the string MEDIAURL with the MEDIA_URL"
> >     return value.replace('MEDIAURL', MEDIA_URL)
>
> > ...and use it like this: {{ object|mediaurl }}
>
> > Is this a bad way to resolve the problem?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to