Permalink
Browse files

REMOVE_WWW_FROM_SUBDOMAIN is a poor setting name, replacing with REMO…

…VE_WWW_FROM_DOMAIN
  • Loading branch information...
1 parent e783c38 commit 244e1ff01cd790db3b7575896e83eaf8b63471b9 @tkaemming committed Apr 26, 2012
Showing with 3 additions and 4 deletions.
  1. +2 −2 subdomains/middleware.py
  2. +1 −2 subdomains/settings.py
@@ -7,7 +7,7 @@
from subdomains.exceptions import IncorrectSiteException
from subdomains.settings import (USE_SUBDOMAIN_EXCEPTION,
- REMOVE_WWW_FROM_SUBDOMAIN)
+ REMOVE_WWW_FROM_DOMAIN)
class SubdomainMiddleware(object):
@@ -19,7 +19,7 @@ def process_request(self, request):
"""
site = Site.objects.get_current()
domain = site.domain
- if REMOVE_WWW_FROM_SUBDOMAIN and domain.startswith("www."):
+ if REMOVE_WWW_FROM_DOMAIN and domain.startswith("www."):
domain = domain.replace("www.", "", 1)
pattern = r'^(?:(?P<subdomain>.*?)\.)?%s(?::.*)?$' % re.escape(domain)
matches = re.match(pattern, request.get_host())
@@ -3,5 +3,4 @@
USE_SUBDOMAIN_EXCEPTION = getattr(settings, 'USE_SUBDOMAIN_EXCEPTION', False)
-REMOVE_WWW_FROM_SUBDOMAIN = getattr(settings, 'REMOVE_WWW_FROM_SUBDOMAIN',
- False)
+REMOVE_WWW_FROM_DOMAIN = getattr(settings, 'REMOVE_WWW_FROM_DOMAIN', False)

0 comments on commit 244e1ff

Please sign in to comment.