Author: batiste.bieler
Date: Wed Apr 15 01:49:45 2009
New Revision: 452

Modified:
    trunk/pages/utils.py

Log:
Try to fix issue 77

Modified: trunk/pages/utils.py
==============================================================================
--- trunk/pages/utils.py        (original)
+++ trunk/pages/utils.py        Wed Apr 15 01:49:45 2009
@@ -8,6 +8,7 @@
  from django.http import HttpResponse, HttpResponseRedirect,  
HttpResponsePermanentRedirect
  from django.core.handlers.wsgi import WSGIRequest
  from django.contrib.sites.models import Site, RequestSite, SITE_CACHE
+from django.core.handlers.base import BaseHandler
  from pages import settings
  from exceptions import Exception as Except

@@ -19,10 +20,17 @@
          temp = loader.get_template(template_name)
      except TemplateDoesNotExist:
          return []
-
-    request = WSGIRequest({'REQUEST_METHOD': 'GET'})
-    request.session = {}
-
+
+    bh = BaseHandler()
+    bh.load_middleware()
+    request = WSGIRequest({
+        'REQUEST_METHOD': 'GET',
+        'SERVER_NAME': 'test',
+        'SERVER_PORT': '8000',
+    })
+    # Apply request middleware
+    for middleware_method in bh._request_middleware:
+        response = middleware_method(request)
      try:
          # to avoid circular import
          from pages.views import details

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" 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/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to