Permalink
Browse files

Release v0.11: Use new Dynamic Site from django-tools, only if a new …

…version of django-tools is installed.
  • Loading branch information...
1 parent 2d9df3c commit 270036095c665855e28fbeebc50e3f8ad61e7d81 @jedie committed Jan 24, 2012
Showing with 29 additions and 7 deletions.
  1. +2 −2 pylucid_project/__init__.py
  2. +25 −4 pylucid_project/settings.py
  3. +2 −1 requirements/normal_installation.txt
@@ -7,7 +7,7 @@
written with the help of the powerful
Webframework Django.
- :copyleft: 2009-2010 by the PyLucid team, see AUTHORS for more details.
+ :copyleft: 2009-2012 by the PyLucid team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
@@ -17,7 +17,7 @@
import subprocess
-__version__ = (0, 10, 3)
+__version__ = (0, 11, 0)
VERSION_STRING = '.'.join(str(part) for part in __version__)
@@ -15,7 +15,7 @@
django documentation for a full list of all items:
http://www.djangoproject.com/documentation/settings/
- :copyleft: 2009-2011 by the PyLucid team, see AUTHORS for more details.
+ :copyleft: 2009-2012 by the PyLucid team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
@@ -88,6 +88,7 @@
ROOT_URLCONF = 'pylucid_project.urls'
+
MIDDLEWARE_CLASSES = (
# Save process informations. More info: https://github.com/jedie/django-processinfo
'django_processinfo.middlewares.django_processinfo.ProcessInfoMiddleware',
@@ -103,11 +104,24 @@
# make the request object everywhere available with a thread local storage:
'django_tools.middlewares.ThreadLocal.ThreadLocalMiddleware',
+)
- # Set SITE_ID dynamically base on the current domain name **Experimental** :
- # To activate set "USE_DYNAMIC_SITE_MIDDLEWARE = True" in your local_settings.py
- 'django_tools.middlewares.DynamicSite.DynamicSiteMiddleware',
+# For backward compatible - FIXME: Remove after v0.12 release
+try:
+ from django_tools import dynamic_site
+except ImportError:
+ # Wrong django-tools version -> skip
+ _DYNAMIC_SITE = False
+else:
+ del(dynamic_site)
+ _DYNAMIC_SITE = True
+ MIDDLEWARE_CLASSES += (
+ # Set SITE_ID dynamically base on the current domain name **Experimental** :
+ # To activate set "USE_DYNAMIC_SITE_MIDDLEWARE = True" in your local_settings.py
+ 'django_tools.dynamic_site.middleware.DynamicSiteMiddleware',
+ )
+MIDDLEWARE_CLASSES += (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.locale.LocaleMiddleware',
@@ -232,6 +246,13 @@
'south',
'django_processinfo',
)
+
+# For backward compatible - FIXME: Remove after v0.12 release
+if _DYNAMIC_SITE:
+ INSTALLED_APPS += ('django_tools.dynamic_site',)
+del(_DYNAMIC_SITE)
+
+
# Add all existing PyLucid apps + plugins
INSTALLED_APPS += PYLUCID_PLUGIN_SETUP_INFO.installed_plugins
#print "settings.INSTALLED_APPS:", "\n".join(INSTALLED_APPS)
@@ -20,7 +20,8 @@ python-creole>=0.8.2,<1.1.0
django-dbpreferences>=0.4.2,<0.5
# http://pypi.python.org/pypi/django-tools
-django-tools>=0.19.6,<0.21
+# FIXME: We should update to >=0.21.1 after PyLucid v0.12 relase:
+django-tools>=0.19.6,<0.22
# http://pypi.python.org/pypi/django-processinfo
django-processinfo>=0.4

0 comments on commit 2700360

Please sign in to comment.