source: mauRepo/HPFos/trunk/hpfos/HPFos/settings.py @ 8508

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/HPFos/trunk/hpfos/HPFos/settings.py@8508
Revision 8508, 6.0 KB checked in by mnagni, 8 years ago (diff)

Incomplete - # 22534: Add versiojn number to the gui page
 http://team.ceda.ac.uk/trac/ceda/ticket/22534
Failed the deployment in cidev.
Fix a configuration problem with DJANGO manage/settings files

  • Property svn:mime-type set to text/plain
Line 
1# Django settings for HPFos project.
2import os
3from osImpl.hpfos_conf import setUp
4
5def decodeRelativePath(relPath):
6    return os.path.join(os.path.dirname(__file__), relPath).replace('\\', '/')   
7   
8DJANGO_PROJECT = os.path.dirname(decodeRelativePath(''))
9SRC = os.path.dirname(DJANGO_PROJECT)
10PROJECT = os.path.dirname(SRC)
11
12DEBUG = False
13TEMPLATE_DEBUG = DEBUG
14
15ADMINS = (
16    # ('Your Name', 'your_email@example.com'),
17)
18
19MANAGERS = ADMINS
20
21DATABASES = {
22    'default': {
23        'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
24        'NAME': '',                      # Or path to database file if using sqlite3.
25        'USER': '',                      # Not used with sqlite3.
26        'PASSWORD': '',                  # Not used with sqlite3.
27        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
28        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
29    }
30}
31
32# Local time zone for this installation. Choices can be found here:
33# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
34# although not all choices may be available on all operating systems.
35# On Unix systems, a value of None will cause Django to use the same
36# timezone as the operating system.
37# If running in a Windows environment this must be set to the same as your
38# system time zone.
39TIME_ZONE = 'America/Chicago'
40
41# Language code for this installation. All choices can be found here:
42# http://www.i18nguy.com/unicode/language-identifiers.html
43LANGUAGE_CODE = 'en-us'
44
45SITE_ID = 1
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
50
51# If you set this to False, Django will not format dates, numbers and
52# calendars according to the current locale.
53USE_L10N = True
54
55# If you set this to False, Django will not use timezone-aware datetimes.
56USE_TZ = True
57
58# Absolute filesystem path to the directory that will hold user-uploaded files.
59# Example: "/home/media/media.lawrence.com/media/"
60MEDIA_ROOT = ''
61
62# URL that handles the media served from MEDIA_ROOT. Make sure to use a
63# trailing slash.
64# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
65MEDIA_URL = ''
66
67# Absolute path to the directory static files should be collected to.
68# Don't put anything in this directory yourself; store your static files
69# in apps' "static/" subdirectories and in STATICFILES_DIRS.
70# Example: "/home/media/media.lawrence.com/static/"
71STATIC_ROOT = ''
72
73# URL prefix for static files.
74# Example: "http://media.lawrence.com/static/"
75STATIC_URL = '/static/'
76
77# Additional locations of static files
78STATICFILES_DIRS = (
79    # Put strings here, like "/home/html/static" or "C:/www/django/static".
80    # Always use forward slashes, even on Windows.
81    # Don't forget to use absolute paths, not relative paths.
82)
83
84# List of finder classes that know how to find static files in
85# various locations.
86STATICFILES_FINDERS = (
87    'django.contrib.staticfiles.finders.FileSystemFinder',
88    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
89#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
90)
91
92# Make this unique, and don't share it with anybody.
93SECRET_KEY = 'ev_@si7x3de#k^y5-cb-@=h8wqpg5wm40p4wh)!nbr!)bubjc9'
94
95# List of callables that know how to import templates from various sources.
96TEMPLATE_LOADERS = (
97    'django.template.loaders.filesystem.Loader',
98    'django.template.loaders.app_directories.Loader',
99#     'django.template.loaders.eggs.Loader',
100)
101
102MIDDLEWARE_CLASSES = (
103    'django.middleware.common.CommonMiddleware',
104    'django.contrib.sessions.middleware.SessionMiddleware',
105    'django.middleware.csrf.CsrfViewMiddleware',
106    'django.contrib.auth.middleware.AuthenticationMiddleware',
107    'django.contrib.messages.middleware.MessageMiddleware',
108    'HPFos.molesSessionMiddleware.MolesSessionMiddleware',   
109    # Uncomment the next line for simple clickjacking protection:
110    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
111)
112
113ROOT_URLCONF = 'HPFos.urls'
114
115# Python dotted path to the WSGI application used by Django's runserver.
116WSGI_APPLICATION = 'HPFos.wsgi.application'
117
118TEMPLATE_DIRS = (
119    decodeRelativePath('template')
120    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
121    # Always use forward slashes, even on Windows.
122    # Don't forget to use absolute paths, not relative paths.
123)
124
125INSTALLED_APPS = (
126    'django.contrib.auth',
127    'django.contrib.contenttypes',
128    'django.contrib.sessions',
129    'django.contrib.sites',
130    'django.contrib.messages',
131    'django.contrib.staticfiles',
132    # Uncomment the next line to enable the admin:
133    # 'django.contrib.admin',
134    # Uncomment the next line to enable admin documentation:
135    # 'django.contrib.admindocs',
136)
137
138# A sample logging configuration. The only tangible logging
139# performed by this configuration is to send an email to
140# the site admins on every HTTP 500 error when DEBUG=False.
141# See http://docs.djangoproject.com/en/dev/topics/logging for
142# more details on how to customize your logging configuration.
143LOGGING = {
144    'version': 1,
145    'disable_existing_loggers': False,
146    'filters': {               
147        #'require_debug_false': {
148        #    '()': 'django.utils.log.RequireDebugFalse'
149        #}
150    },
151    'handlers': {
152        'mail_admins': {
153            'level': 'ERROR',
154            #'filters': ['require_debug_false'],
155            'class': 'django.utils.log.AdminEmailHandler'
156        }
157    },
158    'loggers': {
159        'django.request': {
160            'handlers': ['mail_admins'],
161            'level': 'ERROR',
162            'propagate': True,
163        },
164    }
165}
166
167os_engine = setUp()
168#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
169MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION'   
170if os.environ.has_key('MOLES3_DB_CONNECTION'):
171    MOLES3_DB_CONNECTION = os.environ['MOLES3_DB_CONNECTION']
172
173from ea_model.sqlTables import doTables as doMoles
174MOLES3_DB_SCRIPT = doMoles
175
176# Local modifications to settings are imported from settings_local.py
177from settings_local import *
Note: See TracBrowser for help on using the repository browser.