Created
November 29, 2009 22:39
-
-
Save dlrust/245100 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
in settings.py: | |
MIDDLEWARE_CLASSES = ( | |
'yourproject.middleware.HostnameMiddleware', | |
) | |
""" | |
class HostnameMiddleware: | |
def process_request(self, request): | |
site = get_site_vars(request.META['HTTP_HOST']) | |
request.site = site |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment