| author | ymh <ymh.work@gmail.com> |
| Wed, 10 Jun 2015 16:13:27 +0200 | |
| changeset 162 | 247ef0b10de6 |
| parent 135 | 27065f8a19d3 |
| permissions | -rw-r--r-- |
|
118
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
# -*- coding: utf-8 -*- |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
from . import * |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
import os, logging |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
#TODO override |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
DEBUG = True |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
TEMPLATE_DEBUG = DEBUG |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
BASE_URL = '%(base_url)s' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
WEB_URL = '%(web_url)s' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
PLATFORM_BASE_URL = WEB_URL + BASE_URL + 'ammico/' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
STREAM_SRC_PREFIX = "" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
BASE_STATIC_URL = WEB_URL + BASE_URL + 'static/' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/").rstrip("/")+"/" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
# Absolute path to the directory that holds media. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
# Example: "/home/media/media.lawrence.com/" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
# trailing slash if there is a path component (optional in other cases). |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
MEDIA_URL = BASE_STATIC_URL + 'media/' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
STATIC_URL = BASE_STATIC_URL + 'site/' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
# Absolute path to the directory that static files (js, css, swf...) |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
# DO NOT forget to do command line ./manage.py collectstatic to gather static media into the web/static folder |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
# Make this unique, and don't share it with anybody. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
SECRET_KEY = '%(secret_key)s' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
DATABASES = { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
'default': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
'NAME': '%(db_name)s', # Or path to database file if using sqlite3. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
'USER': '%(db_user)s', # Not used with sqlite3. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
'PASSWORD': '%(db_password)s', # Not used with sqlite3. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3. |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
} |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../run/log/log.txt")) |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
LOG_LEVEL = logging.DEBUG |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
LOGGING = { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
'version': 1, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
'disable_existing_loggers': False, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
'filters': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
'require_debug_false': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
'()': 'django.utils.log.RequireDebugFalse' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
} |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
'formatters' : { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
'simple' : { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
'semi-verbose': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
'handlers': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
'mail_admins': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
'level': 'ERROR', |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
'filters': ['require_debug_false'], |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
'class': 'django.utils.log.AdminEmailHandler' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
'stream_to_console': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
'level': LOG_LEVEL, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
'class': 'logging.StreamHandler' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
'file': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
85 |
'level': LOG_LEVEL, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
'class': 'logging.FileHandler', |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
'filename': LOG_FILE, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
'formatter': 'semi-verbose', |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
'loggers': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
# 'django.db.backends':{ |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
# 'handlers': ['file'], |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
# 'level': LOG_LEVEL, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
# 'propagate': True, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
# }, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
'django.request': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
'handlers': ['file'], |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
'level': LOG_LEVEL, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
'propagate': True, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
'ammico': { |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
'handlers': ['file'], |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
'level': LOG_LEVEL, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
'propagate': True, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
}, |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
} |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
} |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
ADMINS = ( |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
112 |
#('Your Name', 'your_email@domain.com'), |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
) |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
MANAGERS = ADMINS |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
AUTH_JAMESPOT = '' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
|
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
URL_JAMESPOT = '' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
URL_EXALEAD = '' |
|
fea47f1054e2
prepare for server install, mv settings, add setup, correct various problems
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
URL_ORPHEO = '' |