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