DispatcherMiddleware
fabricates environments for your apps and especially SCRIPT_NAME
. Django can deal with it with configuration varibale FORCE_SCRIPT_NAME = ''
(docs).
With Webapp2 it's slightly more complicated. You can create subclass of webapp2.WSGIApplication
and override __call__()
method and force SCRIPT_NAME
to desired value. So in your webapp2_app.py
it could be like this
import webapp2
class WSGIApp(webapp2.WSGIApplication):
def __call__(self, environ, start_response):
environ['SCRIPT_NAME'] = ''
return super(WSGIApp, self).__call__(environ, start_response)
# app = WSGIApp(...)