[Python-checkins] r85168 - in tracker/instances/python-dev: rietveld.wsgi rietveld/roundup_helper/urls.py rietveld/settings.py

martin.v.loewis python-checkins at python.org
Sat Oct 2 12:14:25 CEST 2010


Author: martin.v.loewis
Date: Sat Oct  2 12:14:25 2010
New Revision: 85168

Log:
Incorporate SCRIPT_NAME into PATH_INFO for wsgi.


Modified:
   tracker/instances/python-dev/rietveld.wsgi
   tracker/instances/python-dev/rietveld/roundup_helper/urls.py
   tracker/instances/python-dev/rietveld/settings.py

Modified: tracker/instances/python-dev/rietveld.wsgi
==============================================================================
--- tracker/instances/python-dev/rietveld.wsgi	(original)
+++ tracker/instances/python-dev/rietveld.wsgi	Sat Oct  2 12:14:25 2010
@@ -4,5 +4,15 @@
 import django.core.handlers.wsgi
 import gae2django
 gae2django.install(server_software='Django')
-application = django.core.handlers.wsgi.WSGIHandler()
+_application = django.core.handlers.wsgi.WSGIHandler()
+def application(environ, start_response):
+    # Django's {%url%} template won't prefix script_name,
+    # so clear it here and put everything in path_info
+    environ['PATH_INFO'] = environ['SCRIPT_NAME']+environ['PATH_INFO']
+    environ['SCRIPT_NAME'] = ''
+
+    #start_response('200 Ok', [('Content-type', 'text/plain')])
+    #return ["\n".join([':'.join((str(k),str(v))) for k,v in environ.items()])]
+
+    return _application(environ, start_response)
 

Modified: tracker/instances/python-dev/rietveld/roundup_helper/urls.py
==============================================================================
--- tracker/instances/python-dev/rietveld/roundup_helper/urls.py	(original)
+++ tracker/instances/python-dev/rietveld/roundup_helper/urls.py	Sat Oct  2 12:14:25 2010
@@ -2,6 +2,5 @@
 from django.contrib import admin
 
 urlpatterns = patterns('',
-        ('python-dev/', 'roundup'),
         ('review/', include('rietveld_helper.urls')),
     )

Modified: tracker/instances/python-dev/rietveld/settings.py
==============================================================================
--- tracker/instances/python-dev/rietveld/settings.py	(original)
+++ tracker/instances/python-dev/rietveld/settings.py	Sat Oct  2 12:14:25 2010
@@ -80,7 +80,7 @@
     'django.core.context_processors.request',
 )
 
-ROOT_URLCONF = 'rietveld_helper.urls'
+ROOT_URLCONF = 'roundup_helper.urls'
 
 TEMPLATE_DIRS = (
     os.path.join(os.path.dirname(__file__), 'templates'),


More information about the Python-checkins mailing list