forked from Psycojoker/dierentheater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
136 lines (108 loc) · 2.98 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
# Django settings for dierentuin project.
import os
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
PROJECT = os.path.split(PROJECT_PATH)[1]
import logging
from os.path import exists
if not exists(PROJECT_PATH + "/log/"):
os.mkdir(PROJECT_PATH + "/log/")
if not exists(PROJECT_PATH + "/dump/"):
os.mkdir(PROJECT_PATH + "/dump/")
logger = logging.getLogger('')
# only set loggers once
if not logger.handlers:
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler(PROJECT_PATH + "/log/debug")
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
logger.addHandler(fh)
logger.addHandler(ch)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
CACHE_SCRAPING = True
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine',
'NAME': 'dierentheater',
}
}
TIME_ZONE = 'Europe/Brussels'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = '/static/admin/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
SECRET_KEY = 'q8j8az4jeden%c5hb64vb)unwfq^h$3j+f8&g_+40jd0=l@#qs'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = PROJECT + '.urls'
TEMPLATE_DIRS = (
PROJECT_PATH + '/templates',
)
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sites',
'django.contrib.staticfiles',
'django_extensions',
'lachambre',
'lachambre_parser',
'tastypie',
'tastypie_nonrel',
'scheduler',
'django_crontab',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
CRONTAB_PYTHON_EXECUTABLE = PROJECT_PATH + "/ve/bin/python"
CRONJOBS = [
('1 10,17 * * *', 'scheduler.cron.check_for_new_documents'),
('3 3 * * 3', 'scheduler.cron.reparse_all_documents'),
]
try:
from settings_local import *
except ImportError:
pass