Permalink
Browse files

add SITES_PACKAGE configuration value to match SITES_DIR for finding …

…urls
  • Loading branch information...
wardi committed Mar 29, 2012
1 parent 8f3bc99 commit 5160cbf8aa335d0fb9c95e2d194821802c5340d5
Showing with 5 additions and 4 deletions.
  1. +2 −1 README.rst
  2. +3 −3 dynamicsiteslite/middleware.py
View
@@ -39,9 +39,10 @@ Configuration
'dynamicsiteslite.context_processors.current_site',
)
- 5. Configure dynamicsites by adding SITES_DIR, DEFAULT_HOST, and HOSTNAME_REDIRECTS to settings.py ::
+ 5. Configure dynamicsites by adding SITES_DIR, SITES_PACKAGE, DEFAULT_HOST, and HOSTNAME_REDIRECTS to settings.py ::
SITES_DIR = os.path.join(os.path.dirname(__file__), 'sites')
+ SITES_PACKAGE = 'sites'
DEFAULT_HOST = 'www.your-default-site.com'
HOSTNAME_REDIRECTS = {
# 'redirect-src-1.com': 'www.redirect-dest-1.com',
@@ -83,15 +83,15 @@ def process_request(self, request):
# set from where urlconf will be loaded if it exists
try:
urlconf_pkg = '%s.urls' % folder_name
- __import__("sites.%s" % urlconf_pkg)
+ __import__("%s.%s" % (settings.SITES_PACKAGE, urlconf_pkg))
self.logger.debug('using sites.%s for urlconf',
urlconf_pkg)
self.request.urlconf = urlconf_pkg
except ImportError:
# urlconf doesn't exist... skip it
self.logger.debug(
- 'cannot find sites.%s.urls for urlconf... skipping',
- folder_name)
+ 'cannot find %s.%s.urls for urlconf... skipping',
+ settings.SITES_PACKAGE, folder_name)
pass
# add site templates dir to TEMPLATE_DIRS
self.logger.debug(

0 comments on commit 5160cbf

Please sign in to comment.