| author | ymh <ymh.work@gmail.com> |
| Thu, 02 Apr 2015 22:52:54 +0200 | |
| changeset 613 | 4bb38d03e430 |
| parent 359 | 46ad324f6fe4 |
| permissions | -rw-r--r-- |
|
359
46ad324f6fe4
Correct qery_dbpedia and improve model.
ymh <ymh.work@gmail.com>
parents:
275
diff
changeset
|
1 |
import logging |
| 0 | 2 |
import os |
3 |
||
4 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
|
| 270 | 5 |
BASE_URL = '/hdabo/' |
| 0 | 6 |
WEB_URL = 'http://localhost' |
7 |
||
8 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
|
9 |
# Example: "/home/media/media.lawrence.com/media/" |
|
10 |
MEDIA_ROOT = os.path.abspath(BASE_DIR + "../static/media/") |
|
11 |
||
12 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
13 |
# trailing slash. |
|
14 |
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
|
15 |
MEDIA_URL = BASE_URL + "static/media/" |
|
16 |
||
17 |
# Absolute path to the directory static files should be collected to. |
|
18 |
# Don't put anything in this directory yourself; store your static files |
|
19 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
20 |
# Example: "/home/media/media.lawrence.com/static/" |
|
| 275 | 21 |
STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/site/") |
| 0 | 22 |
|
23 |
# URL prefix for static files. |
|
24 |
# Example: "http://media.lawrence.com/static/" |
|
25 |
STATIC_URL = BASE_URL + "static/site/" |
|
26 |
||
27 |
# Additional locations of static files |
|
28 |
STATICFILES_DIRS = ( |
|
29 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
|
30 |
# Always use forward slashes, even on Windows. |
|
31 |
# Don't forget to use absolute paths, not relative paths. |
|
32 |
) |
|
33 |
||
34 |
||
35 |
DATABASES = { |
|
36 |
'default': { |
|
37 |
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
38 |
'NAME': 'hdabo', # Or path to database file if using sqlite3. |
|
39 |
'USER': 'iri', # Not used with sqlite3. |
|
40 |
'PASSWORD': 'iri', # Not used with sqlite3. |
|
41 |
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. |
|
42 |
'PORT': '5432', # Set to empty string for default. Not used with sqlite3. |
|
43 |
} |
|
44 |
} |
|
45 |
||
| 273 | 46 |
|
47 |
||
|
266
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
48 |
HAYSTACK_CONNECTIONS = { |
|
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
49 |
'default': { |
| 273 | 50 |
# the elasticsearch_backend is probably temporary |
|
266
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
51 |
#'ENGINE': 'hdabo.search.french_whoosh_backend.SearchBackend', |
|
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
52 |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', |
| 273 | 53 |
'URL': 'http://127.0.0.1:9200/', |
54 |
'INDEX_NAME': 'hdabo', |
|
|
266
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
55 |
}, |
|
825ff4d6a8ac
reorganise folders and update venv dependancies (django, etc...)
cavaliet
parents:
176
diff
changeset
|
56 |
} |
|
11
143ab88d17f8
add ordered manytomany fields and indexing
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
57 |
|
| 273 | 58 |
|
59 |
LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt")) |
|
60 |
LOG_LEVEL = logging.DEBUG |
|
61 |
LOGGING = { |
|
62 |
'version': 1, |
|
63 |
'disable_existing_loggers': False, |
|
64 |
'formatters' : { |
|
65 |
'simple' : { |
|
66 |
'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
67 |
}, |
|
68 |
'semi-verbose': { |
|
69 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
70 |
}, |
|
71 |
}, |
|
72 |
'handlers': { |
|
73 |
'mail_admins': { |
|
74 |
'level': 'ERROR', |
|
75 |
'class': 'django.utils.log.AdminEmailHandler' |
|
76 |
}, |
|
77 |
'stream_to_console': { |
|
78 |
'level': LOG_LEVEL, |
|
79 |
'class': 'logging.StreamHandler' |
|
80 |
}, |
|
81 |
'file': { |
|
82 |
'level': LOG_LEVEL, |
|
83 |
'class': 'logging.FileHandler', |
|
84 |
'filename': LOG_FILE, |
|
85 |
'formatter': 'semi-verbose', |
|
86 |
}, |
|
87 |
} , |
|
88 |
'loggers': { |
|
89 |
'hdabo': { |
|
90 |
'handlers': ['file'], |
|
91 |
'level': LOG_LEVEL, |
|
92 |
'propagate': True, |
|
93 |
}, |
|
94 |
'hdalab': { |
|
95 |
'handlers': ['file'], |
|
96 |
'level': LOG_LEVEL, |
|
97 |
'propagate': True, |
|
98 |
}, |
|
99 |
# 'django.db.backends':{ |
|
100 |
# 'handlers': ['file'], |
|
101 |
# 'level': LOG_LEVEL, |
|
102 |
# 'propagate': True, |
|
103 |
# }, |
|
104 |
# 'django.request': { |
|
105 |
# 'handlers': ['file'], |
|
106 |
# 'level': LOG_LEVEL, |
|
107 |
# 'propagate': True, |
|
108 |
# }, |
|
109 |
} |
|
110 |
} |