Hi,

I have the following peculiar problem that is very easy to reproduce. 
I use a simple middleware the attaches the 'app_name' that is defined in 
the urlconf to 'request.user' for subsequent use. 

----
from django.core.urlresolvers import resolve

class ApplicationAwareMiddleware(object):
    """
    Middleware class that determines the name of the application of the 
current
    view and attaches that to the current user.
    """

    def process_request(self, request):

        request.user.app_name = resolve(request.path).app_name
-----

This middleware kills Django's urls resolution when used with mod_wsgi 
using a suppath, like:

         WSGIScriptAlias /subpath <path-to>/django.wsgi

It seems that the call to 'django.core.urlresolvers.resolve' has some kind 
of nasty side-effect.

I tried things like delaying the call to 'resolve', but to no avail. 
Pointers anyone?

Regards, Jan





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/2X0eHZw73twJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to