Fredrik Lundh wrote:
ah, that could work. maybe the process_request handler could just
modify the path attribute, in place ?
that almost worked, but causes some rather interesting problems with
things like CommonMiddleware's URL rewriting, etc.
I came up with this little hack instead:
Index: django/core/handlers/base.py
===================================================================
--- django/core/handlers/base.py (revision 4234)
+++ django/core/handlers/base.py (working copy)
@@ -60,7 +60,10 @@
if response:
return response
- resolver = urlresolvers.RegexURLResolver(r'^/',
settings.ROOT_URLCONF)
+ # Get urlconf from request object, if available. Otherwise use
default.
+ urlconf = getattr(request, "urlconf", settings.ROOT_URLCONF)
+
+ resolver = urlresolvers.RegexURLResolver(r'^/', urlconf)
try:
which, when combined with a trivial middleware class, seems to work
just fine, but I might have missed something.
does someone see any obvious problem with this approach?
could some variation of this perhaps be added to the django core?
(the right way to do this is to add urlconf as a class attribute to
the Request base class, and replace the getattr line with "urlconf =
request.urlconf or settings.ROOT_URLCONF").
</F>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---