root / pithos / settings.py @ f270dad5
History | View | Annotate | Download (4.2 kB)
1 |
#coding=utf8
|
---|---|
2 |
# Django settings for pithos project.
|
3 |
|
4 |
from os.path import abspath, dirname, exists, join |
5 |
|
6 |
PROJECT_PATH = dirname(abspath(__file__)) |
7 |
|
8 |
DEBUG = True
|
9 |
TEMPLATE_DEBUG = DEBUG |
10 |
|
11 |
ADMINS = ( |
12 |
# ('Your Name', 'your_email@domain.com'),
|
13 |
) |
14 |
|
15 |
MANAGERS = ADMINS |
16 |
|
17 |
DATABASES = { |
18 |
'default': {
|
19 |
'ENGINE': 'django.db.backends.sqlite3', |
20 |
'NAME': join(PROJECT_PATH, 'pithos.db') |
21 |
} |
22 |
} |
23 |
|
24 |
# Local time zone for this installation. Choices can be found here:
|
25 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
26 |
# although not all choices may be available on all operating systems.
|
27 |
# If running in a Windows environment this must be set to the same as your
|
28 |
# system time zone.
|
29 |
TIME_ZONE = 'UTC'
|
30 |
|
31 |
# Language code for this installation. All choices can be found here:
|
32 |
# http://www.i18nguy.com/unicode/language-identifiers.html
|
33 |
LANGUAGE_CODE = 'en-us'
|
34 |
|
35 |
SITE_ID = 1
|
36 |
|
37 |
# If you set this to False, Django will make some optimizations so as not
|
38 |
# to load the internationalization machinery.
|
39 |
USE_I18N = True
|
40 |
|
41 |
# If you set this to False, Django will not format dates, numbers and
|
42 |
# calendars according to the current locale
|
43 |
USE_L10N = True
|
44 |
|
45 |
# Absolute path to the directory that holds media.
|
46 |
# Example: "/home/media/media.lawrence.com/"
|
47 |
MEDIA_ROOT = ''
|
48 |
|
49 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
50 |
# trailing slash if there is a path component (optional in other cases).
|
51 |
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
52 |
MEDIA_URL = ''
|
53 |
|
54 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
55 |
# trailing slash.
|
56 |
# Examples: "http://foo.com/media/", "/media/".
|
57 |
ADMIN_MEDIA_PREFIX = '/media/'
|
58 |
|
59 |
# Make this unique, and don't share it with anybody.
|
60 |
SECRET_KEY = '$j0cdrfm*0sc2j+e@@2f-&3-_@2=^!z#+b-8o4_i10@2%ev7si'
|
61 |
|
62 |
# List of callables that know how to import templates from various sources.
|
63 |
TEMPLATE_LOADERS = ( |
64 |
'django.template.loaders.filesystem.Loader',
|
65 |
'django.template.loaders.app_directories.Loader',
|
66 |
) |
67 |
|
68 |
MIDDLEWARE_CLASSES = ( |
69 |
'django.middleware.common.CommonMiddleware',
|
70 |
#'django.middleware.csrf.CsrfViewMiddleware',
|
71 |
#'django.contrib.sessions.middleware.SessionMiddleware',
|
72 |
#'django.contrib.auth.middleware.AuthenticationMiddleware',
|
73 |
#'django.contrib.messages.middleware.MessageMiddleware',
|
74 |
'pithos.middleware.LoggingConfigMiddleware',
|
75 |
'pithos.middleware.SecureMiddleware',
|
76 |
'pithos.middleware.UserMiddleware'
|
77 |
) |
78 |
|
79 |
ROOT_URLCONF = 'pithos.urls'
|
80 |
|
81 |
TEMPLATE_DIRS = ( |
82 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
83 |
# Always use forward slashes, even on Windows.
|
84 |
# Don't forget to use absolute paths, not relative paths.
|
85 |
) |
86 |
|
87 |
# Setup logging (use this name for the setting to avoid conflicts with django > 1.2.x).
|
88 |
LOGGING_SETUP = { |
89 |
'version': 1, |
90 |
'disable_existing_loggers': True, |
91 |
'formatters': {
|
92 |
'simple': {
|
93 |
'format': '%(message)s' |
94 |
}, |
95 |
'verbose': {
|
96 |
'format': '%(asctime)s [%(levelname)s] %(name)s %(message)s' |
97 |
}, |
98 |
}, |
99 |
'handlers': {
|
100 |
'null': {
|
101 |
'class': 'logging.NullHandler', |
102 |
}, |
103 |
'console': {
|
104 |
'class': 'logging.StreamHandler', |
105 |
'formatter': 'verbose' |
106 |
}, |
107 |
'file': {
|
108 |
'class': 'logging.FileHandler', |
109 |
'formatter': 'verbose' |
110 |
}, |
111 |
}, |
112 |
'loggers': {
|
113 |
'pithos': {
|
114 |
'handlers': ['console'], |
115 |
'level': 'DEBUG' if DEBUG else 'INFO' |
116 |
}, |
117 |
} |
118 |
} |
119 |
|
120 |
# The server is behind a proxy (apache and gunicorn setup).
|
121 |
USE_X_FORWARDED_HOST = False
|
122 |
|
123 |
# Set umask (needed for gunicorn setup).
|
124 |
#umask(0077)
|
125 |
|
126 |
# Either set local users here, or a remote host.
|
127 |
# To disable local users set to None.
|
128 |
AUTHENTICATION_USERS = { |
129 |
'0000': 'test', |
130 |
'0001': 'verigak', |
131 |
'0002': 'chazapis', |
132 |
'0003': 'gtsouk', |
133 |
'0004': 'papagian', |
134 |
'0005': 'louridas', |
135 |
'0006': 'chstath', |
136 |
'0007': 'pkanavos', |
137 |
'0008': 'mvasilak', |
138 |
'0009': 'διογένης' |
139 |
} |
140 |
|
141 |
# Where astakos is hosted.
|
142 |
AUTHENTICATION_HOST = '127.0.0.1:10000'
|
143 |
|
144 |
conf = join(PROJECT_PATH, 'settings.local')
|
145 |
if exists(conf):
|
146 |
execfile(conf)
|
147 |
elif exists('/etc/pithos/settings.local'): |
148 |
execfile('/etc/pithos/settings.local') |
149 |
|
150 |
INSTALLED_APPS = ( |
151 |
'pithos.api',
|
152 |
) |