-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
executable file
·152 lines (133 loc) · 5.29 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
import os
ADVANCING_TAGS=[]
EXCLUDED_TAGS=['done','delete','undelete',]
#tags which if you add them, automatically advance to the next photo.
#these are in addition to "done" etc. which are built in.
LOCAL=os.path.exists('local')
MYCAMERAS=[]
#controls whether debugging will stop the server or be skipped
from local_settings import *
print 'DJANGO BASE is',DJANGO_BASE
#you should put the db settings in there.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MANAGERS = ADMINS
STATIC_URL = '/static/'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
TEMPLATE_CONTEXT_PROCESSORS=(
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.media',
'django.core.context_processors.static',
'processors.static_url_processor',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
ROOT_URLCONF = 'urls'
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'day',
'django_extensions',
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s.py:%(lineno)d %(funcName)s() %(message)s',
},
'simple': {
'format': '%(levelname)s %(message)s',
},
'db':{
'format':'%(levelname)s %(duration)s %(sql)s %(params)s %(message)s',
}
},
'handlers': {
'file_log':{
'level':'INFO',
'class':'logging.handlers.RotatingFileHandler',
'filename': '%slogs/tracker.log' % (not LOCAL and (DJANGO_BASE + '/') or ''),
'maxBytes': 500*1024**2, # 500 MB, dumb windows not being able to roll over...
'backupCount': 5,
'formatter':'verbose',
},
'error_log':{
'level':'ERROR',
'class':'logging.handlers.RotatingFileHandler',
'filename': '%slogs/error.log' % (not LOCAL and (DJANGO_BASE + '/') or ''),
'maxBytes': 500*1024**2, # 500 MB, dumb windows not being able to roll over...
'backupCount': 5,
'formatter':'verbose',
},
'null': {
'level':'DEBUG',
'class':'django.utils.log.NullHandler',
},
'console':{
'level':'INFO',
'class':'logging.StreamHandler',
'formatter': 'verbose',
},
'mail_admins': { #most loggers have this in addition to their normal file log. if an error+ thing happens mail me too.
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler',
'formatter':'verbose',
}
},
'loggers': {
'': {
'handlers': ['file_log','error_log','mail_admins',],
'level': 'INFO',
'propagate': True
},
'django': {
'handlers':['null','console','file_log','mail_admins',],
'propagate': True,
'level':'INFO',
},
'django.request': {
'handlers': ['mail_admins','file_log'],
'level': 'ERROR',
'propagate': False,
},
}
}
ADMIN_EXTERNAL_BASE='/admin'
JINJA2_FILTERS=('filters.ipdbfilter','filters.jsonify')
LOGIN_URL = '/admin/'
#the date you start using this. everyone/thing from before this date doesn't have accurate time tracking.
#and as you fill in old info, just set them to longago so that
#time sequence stuff doesn't get messed up if you added it out of order.
import datetime
LONG_AGO = datetime.date(year=2012, month=5, day=1)
LONG_AGO_STR= '2012-05-01'
#INCOMING_PHOTO_DIR is set in local.
assert os.path.exists(INCOMING_PHOTO_DIR),INCOMING_PHOTO_DIR
assert os.path.exists(DONE_PHOTO_DIR),DONE_PHOTO_DIR
assert os.path.exists(DELETED_PHOTO_DIR),DELETED_PHOTO_DIR
assert os.path.exists(DONE_PHOTO_DIR),DONE_PHOTO_DIR
assert os.path.exists(THUMB_PHOTO_DIR),THUMB_PHOTO_DIR
PHOTO_SCALED=750
THUMB_HEIGHT=120
DEFAULT_CURRENCIES=(('dollar','$',6.21),('rmb','rmb',1),)
DEFAULT_DOMAINS=('money','life','work','transportation','body','health','clothes','friends','fun','food','drink','alcohol',)
DEFAULT_REGIONS=(('home','rmb',),('new york','dollar'),('beijing','rmb'),('shanghai','rmb'),('internet','dollar'),)
DEFAULT_PRODUCTS=(('milk','drink',),('water','drink'),('chicken','food',),('vitamins','body',),('taxi','transportation',),('bike','transportation'),)
DEFAULT_PEOPLE=(('existence','the fact of',[],3),('father','',['existence'],1),('mother','',['existence',],2),)
DEFAULT_SOURCES=(('7-11','shanghai'),('corner store','shanghai'),('amazon','internet'),('starbucks','shanghai'))
DEFAULT_PHOTOTAGS='delete undelete done myphoto timelapse friends family meme background mosaic graphics painting done next last undo prev'.split()
TEMPLATE_DEBUG = True
EXCLUDE_FROM_PHOTOSET_TAGS=['done',]