root/trunk/opentrials/settings.py @ 1069

Revision 1069, 8.3 kB (checked in by antonio.alves, 22 months ago)

closing tag

Line 
1# -*- encoding: utf-8 -*-
2
3# OpenTrials: a clinical trials registration system
4#
5# Copyright (C) 2010 BIREME/PAHO/WHO, ICICT/Fiocruz e
6#                    Ministério da Saúde do Brasil
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Lesser General Public License as published
10# by the Free Software Foundation, either version 2.1 of the License, or
11# (at your option) any later version.
12
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU Lesser General Public License for more details.
17
18# You should have received a copy of the GNU Lesser General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21import os
22
23DEBUG = False
24TEMPLATE_DEBUG = DEBUG
25PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
26
27ADMINS = (
28    ('Luciano Ramalho', 'luciano.ramalho@bireme.org'),
29    ('Antonio Ribeiro Alves', 'antonio.alves@bireme.org')
30)
31
32MANAGERS = ADMINS
33
34DATABASE_OPTIONS = {"init_command": "SET storage_engine=INNODB"}
35
36# Local time zone for this installation. Choices can be found here:
37# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38# although not all choices may be available on all operating systems.
39# If running in a Windows environment this must be set to the same as your
40# system time zone.
41TIME_ZONE = 'America/Sao_Paulo'
42
43# Language code for this installation. All choices can be found here:
44# http://www.i18nguy.com/unicode/language-identifiers.html
45LANGUAGE_CODE = 'pt-BR'
46
47# If you set this to False, Django will make some optimizations so as not
48# to load the internationalization machinery.
49USE_I18N = True
50USE_L10N = True
51
52# Absolute path to the directory that holds media.
53# Example: "/home/media/media.lawrence.com/"
54
55MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static')
56
57# URL that handles the media served from MEDIA_ROOT. Make sure to use a
58# trailing slash if there is a path component (optional in other cases).
59# Examples: "http://media.lawrence.com", "http://example.com/media/"
60MEDIA_URL = '/static/'
61
62# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
63# trailing slash.
64# Examples: "http://foo.com/media/", "/media/".
65ADMIN_MEDIA_PREFIX = '/static/media/'
66
67# Make this unique, and don't share it with anybody.
68SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq'
69
70# List of callables that know how to import templates from various sources.
71TEMPLATE_LOADERS = (
72    'django.template.loaders.filesystem.load_template_source',
73    'django.template.loaders.app_directories.load_template_source',
74#     'django.template.loaders.eggs.load_template_source',
75)
76
77MIDDLEWARE_CLASSES = (
78    'django.middleware.gzip.GZipMiddleware',
79    'django.middleware.common.CommonMiddleware',
80    'django.middleware.http.ConditionalGetMiddleware',
81    'django.contrib.sessions.middleware.SessionMiddleware',
82    'django.contrib.auth.middleware.AuthenticationMiddleware',
83    'django.contrib.messages.middleware.MessageMiddleware',
84
85    #'debug_toolbar.middleware.DebugToolbarMiddleware',
86
87    'django.middleware.csrf.CsrfViewMiddleware',
88    'middleware.scriptprefix.ScriptPrefixMiddleware',
89    'django.middleware.locale.LocaleMiddleware',
90    'django.middleware.transaction.TransactionMiddleware',
91    'middleware.user_locale.UserLocaleMiddleware',
92    #'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
93    'flatpages_polyglot.middleware.FlatPagePolyglotMiddleware',
94)
95
96ROOT_URLCONF = 'opentrials.urls'
97LOGIN_REDIRECT_URL = '/accounts/dashboard/'
98
99TEMPLATE_DIRS = (
100    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
101    # Always use forward slashes, even on Windows.
102    # Don't forget to use absolute paths, not relative paths.
103
104    os.path.join(PROJECT_PATH, 'templates'),
105)
106
107INSTALLED_APPS = (
108    'django.contrib.auth',
109    'django.contrib.contenttypes',
110    'django.contrib.sessions',
111    'django.contrib.sites',
112    'django.contrib.admin',
113    'django.contrib.admindocs',
114    'django.contrib.flatpages',
115    'django.contrib.markup',
116    'django.contrib.messages',
117    'django.contrib.syndication',
118   
119    'deleting',
120    'vocabulary',
121    'repository',
122    'reviewapp',
123    'tickets',
124    'assistance',
125    'decsclient',
126    'icd10client',
127    'diagnostic',
128    'polyglot',
129    'registration',  # django-registration package
130    'flatpages_polyglot',
131    'south',
132    'fossil',
133    #'rosetta',
134
135    #'debug_toolbar',
136    'compressor',
137)
138
139TEMPLATE_CONTEXT_PROCESSORS =(
140    'django.core.context_processors.auth',
141    'django.core.context_processors.i18n',
142    'django.core.context_processors.csrf',
143    'django.core.context_processors.media',
144    'django.core.context_processors.request',
145    'context_processors.opentrials.polyglot',
146    'context_processors.opentrials.google_analytics',
147    'context_processors.opentrials.latest_tweets',
148    'context_processors.opentrials.debug',
149    'context_processors.opentrials.default_from_email',
150    'context_processors.opentrials.opentrials_version',
151)
152
153AUTH_PROFILE_MODULE = "reviewapp.UserProfile"
154
155#################################################################
156### BEGIN Clinical Trials Repository customization settings
157###
158### see also settings_local-SAMPLE.py for private customization settings.
159
160# this id must match the record with the correct domain name in the
161# django_site table; the initial values for that table are defined
162# in opentrials/fixtures/initial_data.json
163SITE_ID = 2 # change if necessary to match a record in django_site
164
165SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos'
166SEND_BROKEN_LINK_EMAILS = True
167DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs'
168ICD10_SERVICE = 'http://bases.bireme.br/cgi-bin/mxlindG4.exe/cgi=@cid10/cid10'
169
170TRIAL_ID_PREFIX = 'RBR'
171TRIAL_ID_DIGITS = 6
172
173# Notes:
174# 1) source: http://www.i18nguy.com/unicode/language-identifiers.html
175# 2) the first managed language is considered the default and is
176#    also the source language for content translation purposes
177MANAGED_LANGUAGES_CHOICES = (
178    (u'en', u'English'),
179    (u'es', u'Español'),
180    (u'pt-br', u'Português'),
181)
182TARGET_LANGUAGES = MANAGED_LANGUAGES_CHOICES[1:] # exlude source language
183MANAGED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES_CHOICES]
184# TODO: implement this as default on new submission forms
185#LANGUAGES = MANAGED_LANGUAGES_CHOICES
186DEFAULT_SUBMISSION_LANGUAGE = u'en'
187
188# django-registration: for how long the activation link is valid
189ACCOUNT_ACTIVATION_DAYS = 7
190
191# django-registration: set to False to suspend new user registrations
192REGISTRATION_OPEN = True
193
194ATTACHMENTS_DIR = 'attachments'
195SUBMISSIONS_XML_PATH = 'submissions_xml'
196
197# Name of Primary Registry
198REG_NAME = 'REBEC'
199
200FIXTURE_DIRS = ('fixtures',)
201
202PAGINATOR_CT_PER_PAGE = 10
203
204TWITTER = 'ensaiosclinicos'
205TWITTER_TIMEOUT = 18000 # expires in 5 min
206
207TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
208NOSE_ARGS = ['--with-coverage', '--with-doctest', '--doctest-tests', '--doctest-extension=txt'] # --doctest-fixtures, --with-profile
209#NOSE_PLUGINS = []
210SKIP_SOUTH_TESTS = True
211SOUTH_TESTS_MIGRATE = False
212
213SESSION_EXPIRE_AT_BROWSER_CLOSE = True
214
215FORMAT_MODULE_PATH = 'formats'
216
217# Backup directory
218BACKUP_DIR = os.path.join(MEDIA_ROOT, 'backup')
219
220INTERNAL_IPS = ('127.0.0.1',)
221USE_ETAGS = True
222
223COMPRESS = True
224COMPRESS_OUTPUT_DIR = 'compressor-cache'
225#COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
226#COMPRESS_JS_FILTERS = ['compressor.filters.jsmin.JSMinFilter']
227
228### END Clinical Trials Repository customization settings
229#################################################################
230
231# Deployment settings: there *must* be an unversioned settings_local.include
232# file in the current directory. See sample file at settings_local-SAMPLE.include
233# FIXME: why not use a simple "try: from settings_local import * except ImportError: pass" ?
234execfile(os.path.join(PROJECT_PATH,'settings_local.include'))
235
236#check for write permission in static/attachments, for user's uploads
237ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, ATTACHMENTS_DIR)
238if os.path.exists(ATTACHMENTS_PATH):
239    if not os.access(ATTACHMENTS_PATH, os.W_OK):
240        raise IOError('Attachments folder "%s" must be writeable' %
241                                (ATTACHMENTS_PATH))
242else:
243    raise IOError('Attachments folder "%s" not found' % (ATTACHMENTS_PATH))
244
245OPENTRIALS_VERSION = 'v1.0.24rc7' # this should be the deployed tag number
Note: See TracBrowser for help on using the browser.