-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsettings.py
112 lines (93 loc) · 3.08 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Adriano Monteiro Marques
#
# Author: Piotrek Wasilewski <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
DEBUG = True
# By default Django disables debug mode when running test. However in webapi
# tests we need to know if DEBUG was set to True, otherwise testing this
# application would be difficult.
API_TEST_DEBUG = True if DEBUG else False
if DEBUG:
STATICFILES_DIRS = (
os.path.join(os.path.dirname(__file__), 'static'),
)
else:
STATIC_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'static')
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '%sadmin/' % STATIC_URL
SECRET_KEY = '=r-$b*8hglm+858&9t043hlm6-&6-3d3vfc4((7yd0dbrakhvi'
AUTH_PROFILE_MODULE = 'users.UserProfile'
SITE_ID = 1
SITE_DOMAIN = 'example.com'
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'America/Chicago'
USE_I18N = True
USE_L10N = True
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'piston',
'haystack'
)
if DEBUG:
INSTALLED_APPS += ('django.contrib.staticfiles',)
NETADMIN_APPS = (
'netadmin',
'netadmin.reportmeta',
'netadmin.webapi',
'netadmin.networks',
'netadmin.events',
'netadmin.users',
'netadmin.permissions',
'netadmin.notifier',
'netadmin.utils.charts',
'netadmin.plugins'
)
INSTALLED_APPS += NETADMIN_APPS
SITE_DOMAIN = 'example.com'
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.static',
'django.core.context_processors.request',
'django.core.context_processors.media',
)
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates'),
)
ROOT_URLCONF = 'urls'
LOGIN_URL = '/login/'
if DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
else:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
ACTIVATION_FROM_EMAIL = '[email protected]'
HAYSTACK_SITECONF = 'search_indexes'
HAYSTACK_SEARCH_ENGINE = 'whoosh'
HAYSTACK_WHOOSH_PATH = os.path.join(os.path.dirname(__file__), 'whoosh_index')
try:
from local_settings import *
except ImportError:
pass