ah right, WSGI requests won't have this django_root environ var.

so its the completely non-intuitive SCRIPT_NAME
(I know, its the server that refers to it as this)

this works :

{% django_root %}

@register.tag
def django_root(parser,token):
    return DjangoRootNode()

class DjangoRootNode(template.Node):

    def render(self, context):
        return context['request'].META['SCRIPT_NAME']



thanks Graham



On Sep 30, 4:28 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
>
> But when you do go looking, don't think that accessing 'django.root'
> from mod_python PythonOption dictionary is the correct way. Look for
> 'SCRIPT_NAME' instead, how it is set and how you might access it. By
> using 'SCRIPT_NAME' you will be portable to other hosting mechanisms
> for Django as well.
>
> Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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