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

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

Incomplete - # 22403: CEDA Observation - ceda Internal information
 http://team.ceda.ac.uk/trac/ceda/ticket/22403

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