37976da2a7cab9634c7f78c4a8f4233950834d01
[turniej.git] / src / core / settings.py
1 # Django settings for turniej project.
2 import os.path
3
4 PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
5
6 DEBUG = False
7
8 ADMINS = [
9     # ('Your Name', 'your_email@domain.com'),
10 ]
11
12 MANAGERS = ADMINS
13
14 DATABASES = {
15     'default': {
16         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
17         'NAME': os.path.join(PROJECT_DIR, 'dev.db'), # Or path to database file if using sqlite3.
18         'USER': '',                      # Not used with sqlite3.
19         'PASSWORD': '',                  # Not used with sqlite3.
20         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
21         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
22     }
23 }
24
25 # Local time zone for this installation. Choices can be found here:
26 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
27 # although not all choices may be available on all operating systems.
28 # On Unix systems, a value of None will cause Django to use the same
29 # timezone as the operating system.
30 # If running in a Windows environment this must be set to the same as your
31 # system time zone.
32 TIME_ZONE = None
33
34 # Language code for this installation. All choices can be found here:
35 # http://www.i18nguy.com/unicode/language-identifiers.html
36 LANGUAGE_CODE = 'pl'
37
38 SITE_ID = 1
39
40 # If you set this to False, Django will make some optimizations so as not
41 # to load the internationalization machinery.
42 USE_I18N = True
43
44 # If you set this to False, Django will not format dates, numbers and
45 # calendars according to the current locale
46 #USE_L10N = True
47
48 # Absolute filesystem path to the directory that will hold user-uploaded files.
49 # Example: "/home/media/media.lawrence.com/media/"
50 MEDIA_ROOT = os.path.join(PROJECT_DIR, '../media')
51
52 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
53 # trailing slash.
54 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
55 MEDIA_URL = '/media/'
56
57 # Absolute path to the directory static files should be collected to.
58 # Don't put anything in this directory yourself; store your static files
59 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
60 # Example: "/home/media/media.lawrence.com/static/"
61 STATIC_ROOT = os.path.join(PROJECT_DIR, '../static')
62
63 # URL prefix for static files.
64 # Example: "http://media.lawrence.com/static/"
65 STATIC_URL = '/static/'
66
67 # URL prefix for admin static files -- CSS, JavaScript and images.
68 # Make sure to use a trailing slash.
69 # Examples: "http://foo.com/static/admin/", "/static/admin/".
70 ADMIN_MEDIA_PREFIX = '/static/admin/'
71
72 # Additional locations of static files
73 STATICFILES_DIRS = (
74     # Put strings here, like "/home/html/static" or "C:/www/django/static".
75     # Always use forward slashes, even on Windows.
76     # Don't forget to use absolute paths, not relative paths.
77
78     os.path.join(PROJECT_DIR, 'static'),
79 )
80
81 # List of finder classes that know how to find static files in
82 # various locations.
83 STATICFILES_FINDERS = (
84     'django.contrib.staticfiles.finders.FileSystemFinder',
85     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
86 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
87 )
88
89 TEMPLATES = [
90     {
91         'BACKEND': 'django.template.backends.django.DjangoTemplates',
92         'APP_DIRS': True,
93         'DIRS': [
94             os.path.join(PROJECT_DIR, 'templates'),
95         ],
96         'OPTIONS': {
97             'context_processors': [
98                 "django.template.context_processors.debug",
99                 "django.template.context_processors.i18n",
100                 "django.template.context_processors.media",
101                 "django.template.context_processors.static",
102                 "django.contrib.messages.context_processors.messages",
103                 "django.template.context_processors.request",
104             ],
105         },
106     },
107 ]
108
109 MIDDLEWARE = [
110     'django.middleware.common.CommonMiddleware',
111 ]
112
113 ROOT_URLCONF = 'core.urls'
114
115 INSTALLED_APPS = [
116     'django.contrib.sites',
117     'django.contrib.staticfiles',
118
119     'piwik',
120
121     'fnpdjango',
122     'poetry',
123     'edition1',
124     'edition2',
125 ]
126
127 POETRY_POEMS_FOR_CONTEST = 20
128
129 ALLOWED_HOSTS = [
130     'turniej.wolnelektury.pl',
131 ]
132
133 # Load localsettings, if they exist
134 try:
135     from .localsettings import *
136 except ImportError:
137     pass