>
> 1) If I simply call the view function obtained from resolve(), it will be 
> executed without middleware. I still want all the usual middleware 
> processing to occur though.
>
Undocumented, unsupported, but this might work:
from myproject import wsgi
response = wsgi.application.get_response(request)

or get a fresh handler (slower):
from django.core.handlers.wsgi import WSGIHandler
handler = WSGIHandler()
response = handler.get_response(request)
 

> 2) I'm not sure how to create a fresh HttpRequest object to use for an 
> internal request, so my code awkwardly modifies the request object it was 
> provided in order to use it for a subrequest. That doesn't feel quite 
> proper.
>
 I think deepcopying the request and modifying it makes sense here. 
Otherwise, depending on what you need, you'll need to copy the session and 
csrf cookies, and set up things like request.META['HTTP_HOST'] by hand.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/206019dc-2ad3-468a-96ec-bd2cba2bb80e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to