Changeset 616:1ecc55248c5a
- Timestamp:
- 11/06/12 14:42:30 (11 months ago)
- Branch:
- default
- rebase_source:
- a4c148b18540592b04653e81e01c2a9562560a5e
- Files:
-
- 3 edited
-
cyclope/middleware.py (modified) (3 diffs)
-
cyclope/settings.py (modified) (4 diffs)
-
demo/cyclope_project/db/site.db (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
cyclope/middleware.py
r373 r584 24 24 25 25 import cyclope 26 import cyclope.settings # Leave this here 26 27 27 28 class LayoutMiddleware(object): … … 37 38 request.session['layout'] = layout 38 39 request.session['layout_template'] = layout.get_template_path() 39 40 40 41 else: 41 42 if request.session.has_key('layout'): … … 49 50 request.session['layout_template'] = cyclope.settings.CYCLOPE_DEFAULT_TEMPLATE 50 51 51 52 -
cyclope/settings.py
r615 r616 48 48 """ 49 49 50 import sys, os 50 import os 51 import sys 51 52 52 53 from django.conf import settings … … 111 112 CYCLOPE_PROJECT_NAME = os.path.basename(CYCLOPE_PROJECT_PATH) 112 113 114 CYCLOPE_BASE_CONTENT_TYPES = site.base_content_types 115 113 116 import themes 114 117 … … 131 134 return site_settings 132 135 133 CYCLOPE_BASE_CONTENT_TYPES = site.base_content_types 134 135 CYCLOPE_SITE_SETTINGS = get_site_settings() 136 137 # If the site has already been set up we read some settings 138 # and make them available at module level 139 if CYCLOPE_SITE_SETTINGS is not None: 140 CYCLOPE_BASE_URL = "http://"+ CYCLOPE_SITE_SETTINGS.site.domain 136 def populate_from_site_settings(site_settings): 137 # Read some settings and make them available at module level 138 CYCLOPE_SITE_SETTINGS = site_settings 139 CYCLOPE_BASE_URL = "http://" + CYCLOPE_SITE_SETTINGS.site.domain # FIXME: could be https 141 140 CYCLOPE_CURRENT_THEME = CYCLOPE_SITE_SETTINGS.theme 142 141 if CYCLOPE_CURRENT_THEME in themes.get_local_themes(): … … 159 158 CYCLOPE_DEFAULT_LAYOUT.template) 160 159 161 #TODO(nicoechaniz): fix this workaround. It's here for migrations on the Layout model, which fail to complete with a DatabaseError when this module is imported. Eg: cyclope/migrations/0011... 160 # TODO(nicoechaniz): fix this workaround. It's here for migrations on the 161 # Layout model, which fail to complete with a DatabaseError when this 162 # module is imported. Eg: cyclope/migrations/0011... 162 163 except DatabaseError: 163 164 pass 165 166 # Update the settings module with the settings 167 for name, value in locals().copy().iteritems(): 168 if name.startswith("CYCLOPE"): 169 globals()[name] = value 170 171 CYCLOPE_SITE_SETTINGS = get_site_settings() 172 populate_from_site_settings(CYCLOPE_SITE_SETTINGS) 164 173 165 174 def _refresh_site_settings(sender, instance, created, **kwargs):
Note: See TracChangeset
for help on using the changeset viewer.

