2aa4a33d40bfc09e94ec5307529e8ad4fd93b58a
[fnp-django-template.git] / src / src / project_name / settings / base.py
1 # -*- coding: utf-8 -*-
2 # Base settings for {{ project_name }} project.
3 from __future__ import unicode_literals
4
5 from os import path
6
7 PROJECT_DIR = path.dirname(path.dirname(path.dirname(path.abspath(path.dirname(__file__)))))
8
9
10 # =============
11 #  DJANGO CORE
12 # =============
13
14 INSTALLED_APPS = (
15     '{{ project_name }}',
16     'fnpdjango',
17     'pipeline',
18     # Disable, if not using Piwik.
19     'piwik',
20
21     'django.contrib.admin',
22     'django.contrib.auth',
23     'django.contrib.contenttypes',
24     'django.contrib.messages',
25     'django.contrib.sessions',
26     'django.contrib.staticfiles',
27 )
28
29 LANGUAGE_CODE = 'pl'
30
31 LANGUAGES = (
32     ('pl', u'polski'),
33 #    ('en', u'English'),
34 )
35
36 MEDIA_ROOT = path.join(PROJECT_DIR, 'var/media/')
37 MEDIA_URL = '/media/'
38
39 MIDDLEWARE_CLASSES = [
40     'django.contrib.sessions.middleware.SessionMiddleware',
41     #'django.middleware.locale.LocaleMiddleware',
42     'fnpdjango.middleware.URLLocaleMiddleware',
43     'django.middleware.common.CommonMiddleware',
44     'django.middleware.csrf.CsrfViewMiddleware',
45     'django.contrib.auth.middleware.AuthenticationMiddleware',
46     'django_cas_ng.middleware.CASMiddleware', # Remove if not using CAS.
47     'django.contrib.messages.middleware.MessageMiddleware',
48     'fnpdjango.middleware.SetRemoteAddrFromXRealIP'
49 ]
50
51 ROOT_URLCONF = '{{ project_name }}.urls'
52
53 TEMPLATES = [
54     {
55         'BACKEND': 'django.template.backends.django.DjangoTemplates',
56         'APP_DIRS': True,
57         'OPTIONS': {
58             'context_processors': [
59                 'django.template.context_processors.request',
60                 'django.contrib.auth.context_processors.auth',
61                 'django.contrib.messages.context_processors.messages',
62                 'django.template.context_processors.i18n',
63             ],
64         },
65     },
66 ]
67
68
69 TIME_ZONE = 'Europe/Warsaw'
70 USE_I18N = True
71 USE_L10N = True
72 USE_TZ = True
73 WSGI_APPLICATION = '{{ project_name }}.wsgi.application'
74
75
76 # =============
77 #  DJANGO AUTH
78 # =============
79
80 # Remove if not using CAS.
81 AUTHENTICATION_BACKENDS = (
82     'django.contrib.auth.backends.ModelBackend',
83     'django_cas_ng.backends.CASBackend',
84 )
85
86 # ===============
87 #  DJANGO STATIC
88 # ===============
89
90 STATIC_ROOT = path.join(PROJECT_DIR, 'var/static/')
91 STATIC_URL = '/static/'
92 STATICFILES_STORAGE = 'fnpdjango.utils.pipeline_storage.GzipPipelineCachedStorage'
93
94 STATICFILES_FINDERS = [
95     'django.contrib.staticfiles.finders.FileSystemFinder',
96     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
97     'pipeline.finders.PipelineFinder',
98 ]
99
100
101 # ========
102 #  CAS_NG
103 # ========
104
105 CAS_SERVER_URL = 'https://logowanie.nowoczesnapolska.org.pl/cas/'
106 CAS_VERSION = '3'
107
108
109 # ==========
110 #  PIPELINE
111 # ==========
112
113 PIPELINE_CSS = {
114     'base': {
115         'source_filenames': (
116           'css/base.scss',
117         ),
118         'output_filename': 'compressed/base.css',
119     },
120 }
121
122 PIPELINE_JS = {
123     'base': {
124         'source_filenames': (
125             'jquery.min.js',
126         ),
127         'output_filename': 'compressed/base.js',
128     },
129 }
130
131 PIPELINE_CSS_COMPRESSOR = None
132 PIPELINE_JS_COMPRESSOR = None
133
134 PIPELINE_COMPILERS = (
135     'pipeline.compilers.sass.SASSCompiler',
136 )