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

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

Preliminary commit for the detach/merge SQLAlchemy operation management

RevLine 
[7970]1# Django settings for MolesManager project.
[8042]2import os
[7970]3
[8059]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)
[8054]10
[8059]11
[7970]12DEBUG = True
13TEMPLATE_DEBUG = DEBUG
14
15ADMINS = (
16    # ('Your Name', 'your_email@example.com'),
17)
18
[8096]19PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
20
[8112]21PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1]
[8096]22
[8112]23
[7970]24MANAGERS = ADMINS
25
26DATABASES = {
27    'default': {
28        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
[8211]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.
[8137]30        'NAME': '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3.
[7970]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
[8211]49LANGUAGE_CODE = 'en-gb'
[7970]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
[8089]65
[7970]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 = ''
[8137]70 
[7970]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
[8137]73# in apps' "static/" subdirectories and in STATICFILES_DIRS.
[7970]74# Example: "/home/media/media.lawrence.com/static/"
[8137]75STATIC_ROOT = os.path.join(DJANGO_PROJECT, 'static')
[7970]76
77# URL prefix for static files.
78# Example: "http://media.lawrence.com/static/"
[8138]79
[8211]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)
[7970]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 = (
[8137]94    ()
[7970]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',
[8112]105    'django.contrib.staticfiles.finders.DefaultStorageFinder',
[7970]106)
107
[8112]108
109
110
[7970]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
[8112]121
122
[7970]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',
[8054]129    'molesSessionMiddleware.MolesSessionMiddleware',
[7970]130)
131ROOT_URLCONF = 'MolesManager.urls'
132
[8112]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
[7970]143TEMPLATE_DIRS = (
[8059]144    decodeRelativePath('static/templates')                 
[7970]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
[8059]165SITE_ROOT = DJANGO_PROJECT
[7970]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}
[8054]189
190#moles3 database connection
[7970]191MOLES3 = 'moles3'
[8078]192#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
[8137]193MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION'
[8219]194from sqlTables import doTables as doMoles, attachEvents
[8088]195MOLES3_DB_SCRIPT = doMoles
[8219]196EVENTS_DB = attachEvents
[8077]197
[7970]198
[8054]199#moles2 to moles3 migration database connection
200MIGRATION = 'migration'
[8078]201#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
[8077]202
[8137]203MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION'
[8088]204from libs.migration.db.migrationTables import doTables as doMigration
205MIGRATION_DB_SCRIPT = doMigration
[8082]206
[8211]207RUN_MIGRATION = False
[8082]208#Default to one day
209MIGRATION_INTERVAL = 86400
Note: See TracBrowser for help on using the repository browser.