|
1 import logging |
|
2 import os |
|
3 # Django settings for p4l project. |
|
4 |
|
5 DEBUG = True |
|
6 TEMPLATE_DEBUG = DEBUG |
|
7 |
|
8 ADMINS = ( |
|
9 # ('Your Name', 'your_email@example.com'), |
|
10 ) |
|
11 |
|
12 MANAGERS = ADMINS |
|
13 |
|
14 DATABASES = { |
|
15 'default': { |
|
16 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
|
17 'NAME': '', # Or path to database file if using sqlite3. |
|
18 # The following settings are not used with sqlite3: |
|
19 'USER': '', |
|
20 'PASSWORD': '', |
|
21 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
|
22 'PORT': '', # Set to empty string for default. |
|
23 } |
|
24 } |
|
25 |
|
26 # Hosts/domain names that are valid for this site; required if DEBUG is False |
|
27 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
|
28 ALLOWED_HOSTS = [] |
|
29 |
|
30 # Local time zone for this installation. Choices can be found here: |
|
31 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
32 # although not all choices may be available on all operating systems. |
|
33 # In a Windows environment this must be set to your system time zone. |
|
34 TIME_ZONE = 'America/Chicago' |
|
35 |
|
36 # Language code for this installation. All choices can be found here: |
|
37 # http://www.i18nguy.com/unicode/language-identifiers.html |
|
38 LANGUAGE_CODE = 'en-us' |
|
39 |
|
40 SITE_ID = 1 |
|
41 |
|
42 BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
|
43 BASE_URL = '/~ymh/p4l/' |
|
44 WEB_URL = 'http://localhost' |
|
45 BASE_STATIC_URL = WEB_URL + BASE_URL + 'static/' |
|
46 BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/").rstrip("/")+"/" |
|
47 |
|
48 # Absolute filesystem path to the directory that will hold user-uploaded files. |
|
49 # Example: "/var/www/example.com/media/" |
|
50 MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
51 |
|
52 # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
53 # trailing slash. |
|
54 # Examples: "http://example.com/media/", "http://media.example.com/" |
|
55 MEDIA_URL = BASE_STATIC_URL + "media/" |
|
56 |
|
57 # Absolute path to the directory static files should be collected to. |
|
58 # Don't put anything in this directory yourself; store your static files |
|
59 # in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
60 # Example: "/var/www/example.com/static/" |
|
61 STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
62 |
|
63 # URL prefix for static files. |
|
64 # Example: "http://example.com/static/", "http://static.example.com/" |
|
65 STATIC_URL = BASE_STATIC_URL + 'site/' |
|
66 |
|
67 # Make this unique, and don't share it with anybody. |
|
68 SECRET_KEY = 'change_this_with_very_secret_key' |
|
69 |
|
70 # Python dotted path to the WSGI application used by Django's runserver. |
|
71 WSGI_APPLICATION = 'p4l.wsgi.application' |
|
72 |
|
73 LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt")) |
|
74 LOG_LEVEL = logging.DEBUG |
|
75 |
|
76 LOGGING = { |
|
77 'version': 1, |
|
78 'disable_existing_loggers': False, |
|
79 'filters': { |
|
80 'require_debug_false': { |
|
81 '()': 'django.utils.log.RequireDebugFalse' |
|
82 } |
|
83 }, |
|
84 'formatters' : { |
|
85 'simple' : { |
|
86 'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
87 }, |
|
88 'semi-verbose': { |
|
89 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
90 }, |
|
91 }, |
|
92 'handlers': { |
|
93 'stream_to_console': { |
|
94 'level': LOG_LEVEL, |
|
95 'class': 'logging.StreamHandler' |
|
96 }, |
|
97 'file': { |
|
98 'level': LOG_LEVEL, |
|
99 'class': 'logging.FileHandler', |
|
100 'filename': LOG_FILE, |
|
101 'formatter': 'semi-verbose', |
|
102 }, |
|
103 }, |
|
104 'loggers': { |
|
105 'django.db.backends': { |
|
106 'handlers': ['file'], |
|
107 'level': 'DEBUG', |
|
108 'propagate': True, |
|
109 }, |
|
110 'django.request': { |
|
111 'handlers': ['file'], |
|
112 'level': 'ERROR', |
|
113 'propagate': True, |
|
114 }, |
|
115 'p4l': { |
|
116 'handlers': ['file'], |
|
117 'level': 'DEBUG', |
|
118 'propagate': True, |
|
119 }, |
|
120 'core': { |
|
121 'handlers': ['file'], |
|
122 'level': 'DEBUG', |
|
123 'propagate': True, |
|
124 }, |
|
125 'rdflib_sqlalchemy': { |
|
126 'handlers': ['file'], |
|
127 'level': 'DEBUG', |
|
128 'propagate': True, |
|
129 }, |
|
130 'rdflib.term': { |
|
131 'handlers': ['file'], |
|
132 'level': 'DEBUG', |
|
133 'propagate': True, |
|
134 }, |
|
135 } |
|
136 } |
|
137 |