root / astakos / settings.py @ 2cbaacd5
History | View | Annotate | Download (3.9 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 |
conf = join(PROJECT_PATH, 'settings.local')
|
87 |
|
88 |
if exists(conf):
|
89 |
execfile(conf)
|
90 |
elif exists('/etc/astakos/settings.local'): |
91 |
execfile('/etc/astakos/settings.local') |
92 |
|
93 |
INSTALLED_APPS = ( |
94 |
'astakos.im',
|
95 |
'south',
|
96 |
'django.contrib.auth',
|
97 |
'django.contrib.contenttypes',
|
98 |
'django.contrib.messages',
|
99 |
'django.contrib.sites',
|
100 |
'django.contrib.sessions'
|
101 |
) |
102 |
|
103 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
104 |
'django.contrib.messages.context_processors.messages',
|
105 |
'django.contrib.auth.context_processors.auth',
|
106 |
'django.core.context_processors.i18n',
|
107 |
'django.core.context_processors.media',
|
108 |
'django.core.context_processors.request',
|
109 |
'astakos.im.context_processors.media',
|
110 |
'astakos.im.context_processors.im_modules',
|
111 |
'astakos.im.context_processors.next',
|
112 |
'astakos.im.context_processors.code',
|
113 |
'astakos.im.context_processors.invitations')
|
114 |
|
115 |
AUTHENTICATION_BACKENDS = ('astakos.im.auth_backends.EmailBackend',
|
116 |
'astakos.im.auth_backends.TokenBackend')
|
117 |
|
118 |
CUSTOM_USER_MODEL = 'astakos.im.AstakosUser'
|
119 |
|
120 |
# Use to log to a file.
|
121 |
LOGFILE = None
|
122 |
|
123 |
# The server is behind a proxy (apache and gunicorn setup).
|
124 |
USE_X_FORWARDED_HOST = False
|
125 |
|
126 |
# Set umask (needed for gunicorn setup).
|
127 |
#umask(0077)
|
128 |
|
129 |
# The URL where requests are redirected for login, especially when using the login_required() decorator.
|
130 |
LOGIN_URL = '/im'
|