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

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

committing changes to cedaObservation.js and associated views

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        '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-us'
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/" sub-directories and in STATICFILES_DIRS.
73# Example: "/home/media/media.lawrence.com/static/"
74#STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static')
75
76# URL prefix for static files.
77# Example: "http://media.lawrence.com/static/"
78STATIC_URL = '/static/'
79#STATIC_ROOT = os.path.join(PROJECT_ROOT, STATIC_URL)
80STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
81
82
83# URL prefix for admin static files -- CSS, JavaScript and images.
84# Make sure to use a trailing slash.
85# Examples: "http://foo.com/static/admin/", "/static/admin/".
86ADMIN_MEDIA_PREFIX = '/static/admin/'
87
88# Additional locations of static files
89STATICFILES_DIRS = (
90                    "c:/virtualenvs/www/MolesManager/src/MolesManager/static",
91    # Put strings here, like "/home/html/static" or "C:/www/django/static".
92    # Always use forward slashes, even on Windows.
93    # Don't forget to use absolute paths, not relative paths.
94)
95
96# List of finder classes that know how to find static files in
97# various locations.
98STATICFILES_FINDERS = (
99    'django.contrib.staticfiles.finders.FileSystemFinder',
100    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
101    'django.contrib.staticfiles.finders.DefaultStorageFinder',
102)
103
104
105
106
107# Make this unique, and don't share it with anybody.
108SECRET_KEY = '2ttix#hi63qnw0derz&0(60&65@v=@#5gg9$9r2jw5v)nccfg+'
109
110# List of callables that know how to import templates from various sources.
111TEMPLATE_LOADERS = (
112    'django.template.loaders.filesystem.Loader',
113    'django.template.loaders.app_directories.Loader',
114#     'django.template.loaders.eggs.Loader',
115)
116
117
118
119MIDDLEWARE_CLASSES = (
120    'django.middleware.common.CommonMiddleware',
121    'django.contrib.sessions.middleware.SessionMiddleware',
122    'django.middleware.csrf.CsrfViewMiddleware',
123    'django.contrib.auth.middleware.AuthenticationMiddleware',
124    'django.contrib.messages.middleware.MessageMiddleware',
125    'molesSessionMiddleware.MolesSessionMiddleware',
126)
127ROOT_URLCONF = 'MolesManager.urls'
128
129TEMPLATE_CONTEXT_PROCESSORS = (
130    "django.contrib.auth.context_processors.auth",
131    "django.core.context_processors.debug",
132    "django.core.context_processors.i18n",
133    "django.core.context_processors.media",
134    "django.core.context_processors.request",
135    "django.core.context_processors.static",
136)
137
138
139TEMPLATE_DIRS = (
140    decodeRelativePath('static/templates')                 
141    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
142    # Always use forward slashes, even on Windows.
143    # Don't forget to use absolute paths, not relative paths.
144)
145
146
147INSTALLED_APPS = (
148    'django.contrib.auth',
149    'django.contrib.contenttypes',
150    'django.contrib.sessions',
151    'django.contrib.sites',
152    'django.contrib.messages',
153    'django.contrib.staticfiles',
154    'ea_model',
155    # Uncomment the next line to enable the admin:
156    # 'django.contrib.admin',
157    # Uncomment the next line to enable admin documentation:
158    # 'django.contrib.admindocs',
159        #This line defines where catch the /static/ folder
160)
161
162SITE_ROOT = DJANGO_PROJECT
163
164# A sample logging configuration. The only tangible logging
165# performed by this configuration is to send an email to
166# the site admins on every HTTP 500 error.
167# See http://docs.djangoproject.com/en/dev/topics/logging for
168# more details on how to customize your logging configuration.
169LOGGING = {
170    'version': 1,
171    'disable_existing_loggers': True,
172    'handlers': {
173        'mail_admins': {
174            'level': 'ERROR',
175            'class': 'django.utils.log.AdminEmailHandler'
176        }
177    },
178    'loggers': {
179        'django.request': {
180            'handlers': ['mail_admins'],
181            'level': 'ERROR',
182            'propagate': True,
183        }
184    }
185}
186
187#moles3 database connection
188MOLES3 = 'moles3'
189#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
190#MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION'
191MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MOLES3_DB_CONNECTION'
192
193
194from sqlTables import doTables as doMoles
195MOLES3_DB_SCRIPT = doMoles
196
197
198#moles2 to moles3 migration database connection
199MIGRATION = 'migration'
200#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
201
202#MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION'
203MIGRATION_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/ceda_moles3_test'#'PG_MOLES3_DB_CONNECTION'
204
205from libs.migration.db.migrationTables import doTables as doMigration
206MIGRATION_DB_SCRIPT = doMigration
207
208RUN_MIGRATION = False
209#Default to one day
210MIGRATION_INTERVAL = 86400
Note: See TracBrowser for help on using the repository browser.