forked from nnmware/nnmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
160 lines (132 loc) · 4.27 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# -*- encoding: utf-8 -*-
import os
# Django settings for nnmware project.
DIRNAME = os.path.dirname(__file__)
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
DJANGO_PROJECT = 'nnmware'
DJANGO_SETTINGS_MODULE = 'settings'
FORCE_SCRIPT_NAME = ''
DEBUG = True
LOCAL_DEV = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('YOU NAME', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'nnmware.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
LOCALE_PATHS = (
'/usr/src/nnmware/locale',
)
TIME_ZONE = 'Europe/Moscow'
LANGUAGE_CODE = 'ru-ru'
SITE_ID = 1
USE_I18N = False
MEDIA_ROOT = '/usr/src/nnmware/media'
STATIC_ROOT = os.path.join(DIRNAME, 'static')
MEDIA_URL = '/m/'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
'/usr/src/nnmware/static',
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
# Don't share it with anybody
SECRET_FILE = os.path.join(DIRNAME, 'secret.txt')
try:
SECRET_KEY = open(SECRET_FILE).read().strip()
except IOError:
try:
from random import choice
key = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
SECRET_KEY = ''.join([choice(key) for i in range(50)])
secret = file(SECRET_FILE, 'w')
secret.write(SECRET_KEY)
secret.close()
except IOError:
raise Exception('Please create a %s file with random ' \
'characters to generate your secret key!' % SECRET_FILE)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader')
MIDDLEWARE_CLASSES = (
# 'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.cache.FetchFromCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
AUTHENTICATION_BACKENDS = (
'nnmware.core.backends.UsernameOrEmailAuthBackend',
'nnmware.apps.social.backends.twitter.TwitterBackend',
'nnmware.apps.social.backends.facebook.FacebookBackend',
'nnmware.apps.social.backends.google.GoogleOAuth2Backend',
)
ROOT_URLCONF = 'urls'
TEMPLATE_DIRS = (
os.path.join(DIRNAME, "templates"),
)
#this is used to add additional config variables to each request
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.static',
'django.core.context_processors.csrf',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
'nnmware.apps.social.context_processors.social_auth_by_type_backends',
)
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admindocs',
'grappelli.dashboard',
'grappelli',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'django.contrib.humanize',
'django.contrib.webdesign',
'django.contrib.messages',
'django.contrib.syndication',
'nnmware.core',
'nnmware.apps.social',
'nnmware.apps.money',
'nnmware.apps.booking',
'nnmware.apps.shop',
'nnmware.apps.address',
'nnmware.apps.dossier',
'nnmware.apps.business',
'nnmware.apps.realty',
'nnmware.apps.transport',
'nnmware.demo',
)
ABSOLUTE_URL_OVERRIDES = {
'auth.user': lambda u: "/user/%s/" % u.username,
}
try:
from nnmware_settings import *
except ImportError:
import sys
sys.stderr.write('No addition site config found (nnmware_settings.py\n')
sys.exit(1)