From 1a75062a68aa86b1dc9ed7b1686dc292de123e43 Mon Sep 17 00:00:00 2001 From: Alexandr Nesterenko Date: Wed, 30 Dec 2015 14:58:57 +0000 Subject: [PATCH] update settings --- frontend/frontend/settings.py.example | 59 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/frontend/frontend/settings.py.example b/frontend/frontend/settings.py.example index e999824..05c0c4c 100644 --- a/frontend/frontend/settings.py.example +++ b/frontend/frontend/settings.py.example @@ -15,6 +15,7 @@ import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +PROJECT_DIR = os.path.join(BASE_DIR, 'frontend') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ @@ -37,12 +38,14 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'pipeline', ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', @@ -55,7 +58,7 @@ ROOT_URLCONF = 'frontend.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [os.path.join(PROJECT_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -89,7 +92,12 @@ DATABASES = { # Internationalization # https://docs.djangoproject.com/en/1.8/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = 'en' + +LANGUAGES = ( + ('en', 'English'), + ('ru', 'Russian'), +) TIME_ZONE = 'UTC' @@ -104,3 +112,50 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' + +#STATICFILES_DIRS = ( +# os.path.join(PROJECT_DIR, "assets"), +#) + +STATIC_ROOT = os.path.join(PROJECT_DIR, 'static') + +STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' + +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'pipeline.finders.PipelineFinder', +) + +PIPELINE_COMPILERS = ( + 'pipeline.compilers.less.LessCompiler', + 'pipeline.compilers.sass.SASSCompiler', +) + +PIPELINE_CSS = { + 'app': { + 'source_filenames': ( + 'frontend/assets/stylesheets/application.css', + 'frontend/assets/stylesheets/bootstrap_and_overrides.css.less', + 'frontend/assets/stylesheets/wizard.css.scss', + ), + 'output_filename': 'frontend/css/app.css', + 'extra_context': { + 'media': 'all', + }, + }, +} + +PIPELINE_JS = { + 'app': { + 'source_filenames': ( + 'frontend/assets/js/jquery.js', + 'frontend/assets/js/bootstrap.js', + 'frontend/assets/js/bootstrap_and_overrides.js', + 'frontend/assets/js/setup-tool.js', + ), + 'output_filename': 'frontend/js/app.js', + } +} + +DOWNLOADER_PAGE_URL = 'http://politepol.com/downloader?url='