On Nov 11, 2007 1:44 PM, RichardH <[EMAIL PROTECTED]> wrote: > From researching posts and blogs, I know this is a difficult issue but > was wondering whether anyone has come up with simple solutions?
I had a similar problem. My solution was to setup a context processor which adds a "root" variable to all contexts and then using that variable as in <a href="{{root}}/relative/">...</a> in all templates. Such a processor is easy to create, for example: def add_root_url(request): from django.conf import settings return dict(root=('' if settings.DEBUG else settings.DEPLOYMENT_ROOT)) You need to add the function name to the settings' TEMPLATE_CONTEXT_PROCESSORS tuple. HTH, -- Stefan Matthias Aust --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---