| author | ymh <ymh.work@gmail.com> |
| Tue, 03 Dec 2013 20:55:04 +0100 | |
| changeset 161 | 216b3f9582aa |
| parent 153 | 50f01260eef4 |
| child 162 | 5fe64e9de88b |
| permissions | -rw-r--r-- |
| 0 | 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 |
|
| 119 | 28 |
ALLOWED_HOSTS = ["*"] |
| 0 | 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 |
||
| 121 | 42 |
#absolute path of the src folder |
| 0 | 43 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
| 121 | 44 |
|
45 |
#absolute url of the website without the host nor the protocol |
|
| 0 | 46 |
BASE_URL = '/~ymh/p4l/' |
| 121 | 47 |
|
48 |
#Host and protocol of the website |
|
| 0 | 49 |
WEB_URL = 'http://localhost' |
| 121 | 50 |
|
51 |
#absolute url of the website static resources |
|
52 |
BASE_STATIC_URL = WEB_URL + BASE_URL + 'static/' |
|
53 |
# absolute path for the website static resources |
|
| 0 | 54 |
BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/").rstrip("/")+"/" |
55 |
||
56 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
|
57 |
# Example: "/var/www/example.com/media/" |
|
58 |
MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
59 |
||
60 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
61 |
# trailing slash. |
|
62 |
# Examples: "http://example.com/media/", "http://media.example.com/" |
|
63 |
MEDIA_URL = BASE_STATIC_URL + "media/" |
|
64 |
||
65 |
# Absolute path to the directory static files should be collected to. |
|
66 |
# Don't put anything in this directory yourself; store your static files |
|
67 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
68 |
# Example: "/var/www/example.com/static/" |
|
69 |
STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
70 |
||
71 |
# URL prefix for static files. |
|
72 |
# Example: "http://example.com/static/", "http://static.example.com/" |
|
73 |
STATIC_URL = BASE_STATIC_URL + 'site/' |
|
74 |
||
75 |
# Make this unique, and don't share it with anybody. |
|
76 |
SECRET_KEY = 'change_this_with_very_secret_key' |
|
77 |
||
78 |
# Python dotted path to the WSGI application used by Django's runserver. |
|
79 |
WSGI_APPLICATION = 'p4l.wsgi.application' |
|
80 |
||
| 121 | 81 |
#absolute patrh to the logging file |
| 0 | 82 |
LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt")) |
| 121 | 83 |
#logging level |
| 0 | 84 |
LOG_LEVEL = logging.DEBUG |
85 |
||
| 121 | 86 |
|
87 |
#logging configuration |
|
| 0 | 88 |
LOGGING = { |
89 |
'version': 1, |
|
90 |
'disable_existing_loggers': False, |
|
91 |
'filters': { |
|
92 |
'require_debug_false': { |
|
93 |
'()': 'django.utils.log.RequireDebugFalse' |
|
94 |
} |
|
95 |
}, |
|
96 |
'formatters' : { |
|
97 |
'simple' : { |
|
98 |
'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
99 |
}, |
|
100 |
'semi-verbose': { |
|
101 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
102 |
}, |
|
103 |
}, |
|
104 |
'handlers': { |
|
105 |
'stream_to_console': { |
|
106 |
'level': LOG_LEVEL, |
|
107 |
'class': 'logging.StreamHandler' |
|
108 |
}, |
|
109 |
'file': { |
|
110 |
'level': LOG_LEVEL, |
|
111 |
'class': 'logging.FileHandler', |
|
112 |
'filename': LOG_FILE, |
|
113 |
'formatter': 'semi-verbose', |
|
114 |
}, |
|
115 |
}, |
|
116 |
'loggers': { |
|
117 |
'django.db.backends': { |
|
118 |
'handlers': ['file'], |
|
119 |
'level': 'DEBUG', |
|
120 |
'propagate': True, |
|
121 |
}, |
|
122 |
'django.request': { |
|
123 |
'handlers': ['file'], |
|
124 |
'level': 'ERROR', |
|
125 |
'propagate': True, |
|
126 |
}, |
|
127 |
'p4l': { |
|
128 |
'handlers': ['file'], |
|
129 |
'level': 'DEBUG', |
|
130 |
'propagate': True, |
|
131 |
}, |
|
132 |
'core': { |
|
133 |
'handlers': ['file'], |
|
134 |
'level': 'DEBUG', |
|
135 |
'propagate': True, |
|
136 |
}, |
|
137 |
'rdflib_sqlalchemy': { |
|
138 |
'handlers': ['file'], |
|
139 |
'level': 'DEBUG', |
|
140 |
'propagate': True, |
|
141 |
}, |
|
142 |
'rdflib.term': { |
|
143 |
'handlers': ['file'], |
|
144 |
'level': 'DEBUG', |
|
145 |
'propagate': True, |
|
146 |
}, |
|
147 |
} |
|
148 |
} |
|
149 |
||
| 121 | 150 |
#haystack connections |
|
113
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
151 |
HAYSTACK_CONNECTIONS = { |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
152 |
'default': { |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
153 |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
154 |
'URL': 'http://127.0.0.1:9200/', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
155 |
'INDEX_NAME': 'p4l', |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
156 |
}, |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
157 |
} |
|
c05567404888
First version of indexation. Replace the list view by a search view
ymh <ymh.work@gmail.com>
parents:
14
diff
changeset
|
158 |
|
| 121 | 159 |
# Control the activation of the real time indexing. |
| 119 | 160 |
REALTIME_INDEXING = True |
161 |
||
| 121 | 162 |
# pagination of the list of record |
|
14
52fa6990e0bb
adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
163 |
NB_RECORDS_BY_PAGE = 20 |
| 161 | 164 |
#some control on the pagination appareance |
165 |
PAGINATOR_VISIBLE_RANGE = 5 #number of pages |
|
166 |
PAGINATOR_START_RANGE = 2 #number of pages kept at the beggining and at the end of the range |
|
| 121 | 167 |
|
168 |
# url of the sesame repository containing all the rdf referentials |
|
|
14
52fa6990e0bb
adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
169 |
SPARQL_QUERY_ENDPOINT = "http://localhost:8080/openrdf-sesame/repositories/plan4learning" |
|
52fa6990e0bb
adapt model to new rdf serialization
ymh <ymh.work@gmail.com>
parents:
0
diff
changeset
|
170 |
|
|
145
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
121
diff
changeset
|
171 |
# cf http://docs.python.org/2/library/subprocess.html#popen-constructor |
|
153
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
172 |
ADMIN_SCRIPT = { |
|
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
173 |
'args' : [ sys.executable, "manage.py", "dump_record", "--newline", "-j", "/tmp/script_dump.rdf.bz2"], |
|
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
174 |
'cwd' : "/Users/ymh/dev/workspace/plan4learning/src", |
|
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
175 |
'env' : {'PYTHONPATH': '/Users/ymh/dev/venvs/p4l/lib/python2.7/site-packages'} |
|
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
176 |
} |
|
50f01260eef4
Correction on admin script configuration.
ymh <ymh.work@gmail.com>
parents:
145
diff
changeset
|
177 |
|
| 161 | 178 |