On 7/16/08, Jon Brisbin <[EMAIL PROTECTED]> wrote:
>
> I can't find a good answer to this in the Django docs: is there a good
> way to access site-specific settings from your templates without
> having to put them in context variables? I've got my media served by
> Apache and everything else by Django. In my templates, I've got an
> ugly hack to check for the existence of a "site_base_url" variable or
> default to localhost. This is a mess because I can't test it from my
> iPod without using a hostname, but I can't get context variables to
> the views I don't have control over (like login/logout, etc...), so my
> templates don't have the "site_base_url" for everything.
>
> Do I have to write some custom middleware that will add my global
> application settings to every request, then reference them through the
> RequestContext I'm passing in to render_to_response? Or is there some
> other feature of views I'm missing (I've read so much on Django
> lately, I'm starting to forget what I've read and what I haven't)?
>
> Thanks!
>
> Jon Brisibn
> http://jbrisbin.com
>
>
> >
>

-- 
Sent from Google Mail for mobile | mobile.google.com

--~--~---------~--~----~------------~-------~--~----~
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