From 70325e6491ad6b5c6e5cb64186158dc4f0fa4f9d Mon Sep 17 00:00:00 2001 From: Bachurin Sergey Date: Sat, 21 Jun 2014 19:29:46 +0300 Subject: [PATCH] cms added --- project/settings.py | 40 +++++++++++++++++++++++++++++++++++++--- project/urls.py | 4 ++-- requirements-dev.txt | 3 ++- requirements.txt | 6 ++++-- 4 files changed, 45 insertions(+), 8 deletions(-) diff --git a/project/settings.py b/project/settings.py index 7890082..cc80756 100644 --- a/project/settings.py +++ b/project/settings.py @@ -109,11 +109,29 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'cms.middleware.page.CurrentPageMiddleware', + 'cms.middleware.user.CurrentUserMiddleware', + 'cms.middleware.toolbar.ToolbarMiddleware', + 'cms.middleware.language.LanguageCookieMiddleware', # my 'project.customer.middleware.ProfileMiddleware', ) +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django.core.context_processors.i18n', + 'django.core.context_processors.request', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'cms.context_processors.cms_settings', + 'sekizai.context_processors.sekizai', +) + + ROOT_URLCONF = 'project.urls' # Python dotted path to the WSGI application used by Django's runserver. @@ -134,13 +152,20 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: - 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - 'django.contrib.admindocs', 'pytils', 'django_filters', 'autocomplete_light', + 'cms', + 'cms', # django CMS itself + 'mptt', # utilities for implementing a modified pre-order traversal tree + 'menus', # helper for model independent hierarchical website navigation + 'sekizai', # for javascript and css management + 'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list before 'django.contrib.admin'. + 'django.contrib.messages', # to enable messages framework (see :ref:`Enable messages `) + + 'django.contrib.admin', + 'django.contrib.admindocs', # my apps 'project.commons', @@ -194,6 +219,15 @@ PDF_FONTS_ROOT = path('pdf_fonts') XLS_ROOT = path('xls_templates') +LANGUAGES = ( + ('ru', 'Russian'), + #('en', gettext('English')), +) +CMS_TEMPLATES = ( + ('pages/index.html', 'Index Page'), + ('template_2.html', 'Template Two'), +) + try: from project.local_settings import * except ImportError: diff --git a/project/urls.py b/project/urls.py index f2bf327..9ae0317 100644 --- a/project/urls.py +++ b/project/urls.py @@ -18,11 +18,11 @@ urlpatterns = patterns('', # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), url(r'autocomplete/', include('autocomplete_light.urls')), - url(r'^$', 'project.pages.views.site_index', name='site_index'), - + # url(r'^$', 'project.pages.views.site_index', name='site_index'), url(r'^my/', include('project.customer.urls')), url(r'^my/docs/', include('project.docs.urls')), url(r'^user/', include('project.myauth.urls')), + url(r'^', include('cms.urls')), ) diff --git a/requirements-dev.txt b/requirements-dev.txt index 96615c5..3a283d7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -14,9 +14,10 @@ pytils==0.2.3 psycopg2 flup django-autocomplete-light==1.4.9 +django-cms==3.0.2 # dev django-devserver django-eml-email-backend django-debug-toolbar -ipython \ No newline at end of file +ipython diff --git a/requirements.txt b/requirements.txt index d342792..190cedc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==1.5.5 +Django==1.5.8 South==0.8.2 pillow==2.2.1 simplejson==3.3.1 @@ -14,9 +14,11 @@ pytils==0.2.3 psycopg2 flup django-autocomplete-light==1.4.9 +django-cms==3.0.2 # dev #django-devserver #django-eml-email-backend django-debug-toolbar -ipython \ No newline at end of file +ipython +