source: mauRepo/MolesManager/trunk/src/MolesManager/settings.py @ 8250

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/MolesManager/settings.py@8280
Revision 8250, 7.5 KB checked in by mnagni, 8 years ago (diff)

Incomplete - # 22428: CEDA Project - observationCollection
 http://team.ceda.ac.uk/trac/ceda/ticket/22428
Complete - # 22388: CEDA Observation - inSupportOf
 http://team.ceda.ac.uk/trac/ceda/ticket/22388
Complete - # 22386: CEDA Observation - title
 http://team.ceda.ac.uk/trac/ceda/ticket/22386

Line 
1# Django settings for MolesManager project.
2import os
3
4def decodeRelativePath(relPath):
5    return os.path.join(os.path.dirname(__file__), relPath).replace('\\', '/')   
6   
7DJANGO_PROJECT = os.path.dirname(decodeRelativePath(''))
8SRC = os.path.dirname(DJANGO_PROJECT)
9PROJECT = os.path.dirname(SRC)
10
11
12DEBUG = True
13TEMPLATE_DEBUG = DEBUG
14
15ADMINS = (
16    # ('Your Name', 'your_email@example.com'),
17)
18
19PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
20
21PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
22
23
24MANAGERS = ADMINS
25
26DATABASES = {
27    'default': {
28        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
29        'NAME': PROJECT_ROOT+'/sqlite.db',                      # Or path to database file if using sqlite3.
30        'USER': '',                      # Not used with sqlite3.
31        'PASSWORD': '',                  # Not used with sqlite3.
32        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
33        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
34    }
35}
36
37# Local time zone for this installation. Choices can be found here:
38# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39# although not all choices may be available on all operating systems.
40# On Unix systems, a value of None will cause Django to use the same
41# timezone as the operating system.
42# If running in a Windows environment this must be set to the same as your
43# system time zone.
44TIME_ZONE = 'America/Chicago'
45
46# Language code for this installation. All choices can be found here:
47# http://www.i18nguy.com/unicode/language-identifiers.html
48LANGUAGE_CODE = 'en-gb'
49
50SITE_ID = 1
51
52# If you set this to False, Django will make some optimizations so as not
53# to load the internationalization machinery.
54USE_I18N = True
55
56# If you set this to False, Django will not format dates, numbers and
57# calendars according to the current locale
58USE_L10N = True
59
60# Absolute filesystem path to the directory that will hold user-uploaded files.
61# Example: "/home/media/media.lawrence.com/media/"
62MEDIA_ROOT = ''
63
64
65# URL that handles the media served from MEDIA_ROOT. Make sure to use a
66# trailing slash.
67# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
68MEDIA_URL = ''
69 
70# Absolute path to the directory static files should be collected to.
71# Don't put anything in this directory yourself; store your static files
72# in apps' "static/" subdirectories and in STATICFILES_DIRS.
73# Example: "/home/media/media.lawrence.com/static/"
74STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static')
75
76# URL prefix for static files.
77# Example: "http://media.lawrence.com/static/"
78
79#Deployment parameterized version
80#STATIC_URL = 'http://localhost'
81STATIC_URL = 'http://127.0.0.1:8000/static/'
82#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL)
83#STATIC_URL = '/static/'
84#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL)
85
86# URL prefix for admin static files -- CSS, JavaScript and images.
87# Make sure to use a trailing slash.
88# Examples: "http://foo.com/static/admin/", "/static/admin/".
89ADMIN_MEDIA_PREFIX = '/static/admin/'
90
91# Additional locations of static files
92STATICFILES_DIRS = (
93    ()
94    # Put strings here, like "/home/html/static" or "C:/www/django/static".
95    # Always use forward slashes, even on Windows.
96    # Don't forget to use absolute paths, not relative paths.
97)
98
99# List of finder classes that know how to find static files in
100# various locations.
101STATICFILES_FINDERS = (
102    'django.contrib.staticfiles.finders.FileSystemFinder',
103    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
104    'django.contrib.staticfiles.finders.DefaultStorageFinder',
105)
106
107
108
109
110# Make this unique, and don't share it with anybody.
111SECRET_KEY = '2ttix#hi63qnw0derz&0(60&65@v=@#5gg9$9r2jw5v)nccfg+'
112
113# List of callables that know how to import templates from various sources.
114TEMPLATE_LOADERS = (
115    'django.template.loaders.filesystem.Loader',
116    'django.template.loaders.app_directories.Loader',
117#     'django.template.loaders.eggs.Loader',
118)
119
120
121
122MIDDLEWARE_CLASSES = (
123    'django.middleware.common.CommonMiddleware',
124    'django.contrib.sessions.middleware.SessionMiddleware',
125    'django.middleware.csrf.CsrfViewMiddleware',
126    'django.contrib.auth.middleware.AuthenticationMiddleware',
127    'django.contrib.messages.middleware.MessageMiddleware',
128    'molesSessionMiddleware.MolesSessionMiddleware',
129)
130ROOT_URLCONF = 'MolesManager.urls'
131
132TEMPLATE_CONTEXT_PROCESSORS = (
133    "django.contrib.auth.context_processors.auth",
134    "django.core.context_processors.debug",
135    "django.core.context_processors.i18n",
136    "django.core.context_processors.media",
137    "django.core.context_processors.request",
138    "django.core.context_processors.static",
139)
140
141
142TEMPLATE_DIRS = (
143    decodeRelativePath('static/templates')                 
144    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
145    # Always use forward slashes, even on Windows.
146    # Don't forget to use absolute paths, not relative paths.
147)
148
149INSTALLED_APPS = (
150    'django.contrib.auth',
151    'django.contrib.contenttypes',
152    'django.contrib.sessions',
153    'django.contrib.sites',
154    'django.contrib.messages',
155    'django.contrib.staticfiles',
156    'ea_model',
157    # Uncomment the next line to enable the admin:
158    # 'django.contrib.admin',
159    # Uncomment the next line to enable admin documentation:
160    # 'django.contrib.admindocs',
161        #This line defines where catch the /static/ folder
162)
163
164SITE_ROOT = DJANGO_PROJECT
165
166# A sample logging configuration. The only tangible logging
167# performed by this configuration is to send an email to
168# the site admins on every HTTP 500 error.
169# See http://docs.djangoproject.com/en/dev/topics/logging for
170# more details on how to customize your logging configuration.
171LOGGING = {
172    'version': 1,
173    'disable_existing_loggers': True,
174    'formatters': {
175        'verbose': {
176            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
177        },
178        'simple': {
179            'format': '%(levelname)s %(message)s'
180        },
181    },   
182    'handlers': {
183        'mail_admins': {
184            'level': 'ERROR',
185            'class': 'django.utils.log.AdminEmailHandler'
186        },
187        'console':{
188            'level':'DEBUG',
189            'class':'logging.StreamHandler',
190            'formatter': 'verbose'
191        }
192    },
193    'loggers': {
194        'django.request': {
195            'handlers': ['mail_admins'],
196            'level': 'ERROR',
197            'propagate': True,
198        },
199        'sqlalchemy.engine': {
200            'handlers': ['console'],
201            'level': 'WARN',
202            'propagate': True,
203        }
204    }
205}
206
207#moles3 database connection
208MOLES3 = 'moles3'
209#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
210MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION'
211from sqlTables import doTables as doMoles, attachEvents
212MOLES3_DB_SCRIPT = doMoles
213EVENTS_DB = attachEvents
214
215
216#moles2 to moles3 migration database connection
217MIGRATION = 'migration'
218#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
219MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION'
220from libs.migration.db.migrationTables import doTables as doMigration
221MIGRATION_DB_SCRIPT = doMigration
222
223#INFO_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
224INFO_DB_CONNECTION = 'PG_INFO_DB_CONNECTION'
225
226
227RUN_MIGRATION = True
228#Default to one day
229MIGRATION_INTERVAL = 86400
230
231# Set this boolean to include static URL patterns for CSS, JS, etc. in urls.py
232SERVE_STATIC_CONTENT = False
233
234# Local modifications to settings are imported from settings_local.py
235from settings_local import *
Note: See TracBrowser for help on using the repository browser.