Login

Middleware that fixes URLs generation for admin and {% url %} for SCGI and WSGI

Author:
dottedmag
Posted:
July 11, 2007
Language:
Python
Version:
.96
Tags:
middleware url relative
Score:
1 (after 1 ratings)

This middleware fixes generation of URLs for admin interface and {% url %} resolving when you're mounting application to the subtree of site, e.g. if you use SCGIMount /prefix/ and serve application using SCGI, or if you use WSGI and want to bind Django application to some prefix.

1
2
3
class MountRedirect(object):
    def process_request(self, request):
        request.path = request.META.get('SCRIPT_NAME', '') + request.path

More like this

  1. simple app using RestViews by kuba 6 years, 1 month ago
  2. SSL Middleware for Webfaction by parlar 7 years, 9 months ago
  3. Django app WSGI by ofalk 5 years, 8 months ago
  4. Enforce site wide login by chbrown 6 years, 4 months ago
  5. Application-independent permalink to admin url for an object by dchandek 7 years ago

Comments

Please login first before commenting.