commit 7fced7cbaeff469db804ad7fba37f78055020e6b Author: Tomas Gavenciak Date: Wed Nov 5 15:13:59 2014 +0100 Initialised with djangocms-installer for Dj 1.6 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..da700d38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/static +/media +*.pyc diff --git a/mamweb/__init__.py b/mamweb/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/mamweb/settings.py b/mamweb/settings.py new file mode 100644 index 00000000..70dcaddd --- /dev/null +++ b/mamweb/settings.py @@ -0,0 +1,192 @@ +import os +gettext = lambda s: s +""" +Django settings for mamweb project. + +For more information on this file, see +https://docs.djangoproject.com/en/1.6/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.6/ref/settings/ +""" + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +BASE_DIR = os.path.dirname(os.path.dirname(__file__)) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'mj+$6#xw$a8l0!l$qk^mwm@&x+(!*vp5**8j*naxe5*0l_kjv*' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + + + + + +ROOT_URLCONF = 'mamweb.urls' + +WSGI_APPLICATION = 'mamweb.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/1.6/ref/settings/#databases + + + +# Internationalization +# https://docs.djangoproject.com/en/1.6/topics/i18n/ + +LANGUAGE_CODE = 'cs' + +TIME_ZONE = 'Europe/Prague' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.6/howto/static-files/ + +STATIC_URL = '/static/' +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +STATIC_ROOT = os.path.join(BASE_DIR, 'static') + +STATICFILES_DIRS = ( + os.path.join(BASE_DIR, 'mamweb', 'static'), +) +SITE_ID = 1 + +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + 'django.template.loaders.eggs.Loader' +) + +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'cms.middleware.user.CurrentUserMiddleware', + 'cms.middleware.page.CurrentPageMiddleware', + 'cms.middleware.toolbar.ToolbarMiddleware', + 'cms.middleware.language.LanguageCookieMiddleware' +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + 'django.core.context_processors.i18n', + 'django.core.context_processors.debug', + 'django.core.context_processors.request', + 'django.core.context_processors.media', + 'django.core.context_processors.csrf', + 'django.core.context_processors.tz', + 'sekizai.context_processors.sekizai', + 'django.core.context_processors.static', + 'cms.context_processors.cms_settings' +) + +TEMPLATE_DIRS = ( + os.path.join(BASE_DIR, 'mamweb', 'templates'), +) + +INSTALLED_APPS = ( + 'djangocms_admin_style', + 'djangocms_text_ckeditor', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.admin', + 'django.contrib.sites', + 'django.contrib.sitemaps', + 'django.contrib.staticfiles', + 'django.contrib.messages', + 'cms', + 'mptt', + 'menus', + 'south', + 'sekizai', + 'djangocms_style', + 'djangocms_column', + 'djangocms_file', + 'djangocms_flash', + 'djangocms_googlemap', + 'djangocms_inherit', + 'djangocms_link', + 'djangocms_picture', + 'djangocms_teaser', + 'djangocms_video', + 'reversion', + 'mamweb' +) + +LANGUAGES = ( + ## Customize this + ('cs', gettext('cs')), + ('en', gettext('en')), +) + +CMS_LANGUAGES = { + ## Customize this + 'default': { + 'public': True, + 'hide_untranslated': False, + 'redirect_on_fallback': True, + }, + 1: [ + { + 'public': True, + 'code': 'cs', + 'hide_untranslated': False, + 'name': gettext('cs'), + 'redirect_on_fallback': True, + }, + { + 'public': True, + 'code': 'en', + 'hide_untranslated': False, + 'name': gettext('en'), + 'redirect_on_fallback': True, + }, + ], +} + +CMS_TEMPLATES = ( + ## Customize this + ('page.html', 'Page'), + ('feature.html', 'Page with Feature') +) + +CMS_PERMISSION = True + +CMS_PLACEHOLDER_CONF = {} + +DATABASES = { + 'default': + {'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'project.db', 'HOST': 'localhost', 'USER': '', 'PASSWORD': '', 'PORT': ''} +} + +SOUTH_MIGRATION_MODULES = { + 'reversion': 'reversion.south_migrations', +} diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html new file mode 100644 index 00000000..4e3b83a6 --- /dev/null +++ b/mamweb/templates/base.html @@ -0,0 +1,38 @@ +{% load cms_tags staticfiles sekizai_tags menu_tags %} + + + + {% block title %}This is my new project home page{% endblock title %} + + {% render_block "css" %} + + + + + {% cms_toolbar %} +
+ + {% block content %} + {% endblock content %} +
+ + + {% render_block "js" %} + + + diff --git a/mamweb/templates/feature.html b/mamweb/templates/feature.html new file mode 100644 index 00000000..c6dc9592 --- /dev/null +++ b/mamweb/templates/feature.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% load cms_tags staticfiles sekizai_tags menu_tags %} + +{% block content %} +
+ {% placeholder "feature" %} +
+
+ {% placeholder "content" %} +
+{% endblock content %} diff --git a/mamweb/templates/menu.html b/mamweb/templates/menu.html new file mode 100644 index 00000000..64db1d25 --- /dev/null +++ b/mamweb/templates/menu.html @@ -0,0 +1,18 @@ +{% load i18n menu_tags cache %} + +{% for child in children %} + + + + +{% if class and forloop.last and not forloop.parentloop %} +{% endif %} +{% endfor %} diff --git a/mamweb/templates/page.html b/mamweb/templates/page.html new file mode 100644 index 00000000..ddf8fda6 --- /dev/null +++ b/mamweb/templates/page.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load cms_tags staticfiles sekizai_tags menu_tags %} + +{% block content %} +
+ {% placeholder "content" %} +
+{% endblock content %} diff --git a/mamweb/urls.py b/mamweb/urls.py new file mode 100644 index 00000000..d0208476 --- /dev/null +++ b/mamweb/urls.py @@ -0,0 +1,22 @@ +from django.conf.urls import * # NOQA +from django.conf.urls.i18n import i18n_patterns +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.contrib import admin +from django.conf import settings +from cms.sitemaps import CMSSitemap + +admin.autodiscover() + +urlpatterns = i18n_patterns('', + url(r'^admin/', include(admin.site.urls)), # NOQA + url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', + {'sitemaps': {'cmspages': CMSSitemap}}), + url(r'^', include('cms.urls')), +) + +# This is only needed when using runserver. +if settings.DEBUG: + urlpatterns = patterns('', + url(r'^media/(?P.*)$', 'django.views.static.serve', # NOQA + {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), + ) + staticfiles_urlpatterns() + urlpatterns # NOQA diff --git a/mamweb/wsgi.py b/mamweb/wsgi.py new file mode 100644 index 00000000..f1604f03 --- /dev/null +++ b/mamweb/wsgi.py @@ -0,0 +1,14 @@ +""" +WSGI config for mamweb project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ +""" + +import os +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mamweb.settings") + +from django.core.wsgi import get_wsgi_application +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 00000000..24eeef69 --- /dev/null +++ b/manage.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mamweb.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv)