From d9509698dac0831baad1b725710a72e0ef0dffca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jordan=20Aug=C3=A9?= Date: Tue, 6 Aug 2013 17:36:48 +0200 Subject: [PATCH] adapted setting for CMS --- myslice/settings.py | 66 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/myslice/settings.py b/myslice/settings.py index c9b30058..746ecbcf 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -1,5 +1,10 @@ +# -*- coding: utf-8 -*- # Django settings for myslice project. +import os +gettext = lambda s: s +PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) + import os.path DEBUG = True @@ -128,8 +133,26 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', + + # CMS + 'cms.middleware.multilingual.MultilingualURLMiddleware', + 'cms.middleware.page.CurrentPageMiddleware', + 'cms.middleware.user.CurrentUserMiddleware', + 'cms.middleware.toolbar.ToolbarMiddleware', ) +# CMS +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.i18n', + 'django.core.context_processors.request', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'cms.context_processors.media', + 'sekizai.context_processors.sekizai', +) + + ROOT_URLCONF = 'myslice.urls' # Python dotted path to the WSGI application used by Django's runserver. @@ -140,7 +163,19 @@ TEMPLATE_DIRS = ( # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(ROOT,"all-templates"), + + # CMS + os.path.join(PROJECT_PATH, "templates"), +) + +# CMS +CMS_TEMPLATES = ( + ('template_1.html', 'Template One'), + ('template_2.html', 'Template Two'), ) +LANGUAGES = [ + ('en', 'English'), +] INSTALLED_APPS = ( 'django.contrib.auth', @@ -162,7 +197,7 @@ INSTALLED_APPS = ( 'views', 'trash', # Uncomment the next line to enable the admin: - # 'django.contrib.admin', + 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', 'portal', @@ -173,6 +208,35 @@ INSTALLED_APPS = ( # DEPRECATED # 'django.contrib.auth', # DEPRECATED # 'django.contrib.sites', # DEPRECATED # 'registration', + + # CMS : Django CMS + 'cms', # django CMS itself + 'mptt', # utilities for implementing a modified pre-order traversal tree + 'menus', # helper for model independent hierarchical website navigation + 'south', # intelligent schema and data migrations + 'sekizai', # for javascript and css management + # + plugins: + 'cms.plugins.flash', + 'cms.plugins.googlemap' + 'cms.plugins.link', + 'cms.plugins.snippet', + 'cms.plugins.text', + 'cms.plugins.twitter', + # either + 'cms.plugins.file', + 'cms.plugins.picture', + 'cms.plugins.teaser', + 'cms.plugins.video', + # or + #'filer', + #'cmsplugin_filer_file', + #'cmsplugin_filer_folder', + #'cmsplugin_filer_image', + #'cmsplugin_filer_teaser', + #'cmsplugin_filer_video', + + # Versioning of content + 'reversion', ) ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value. -- 2.43.0