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

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

The previous settings.y commit was not correct

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
19MANAGERS = ADMINS
20
21DATABASES = {
22    'default': {
23        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
24        'NAME': '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # 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# Absolute filesystem path to the directory that will hold user-uploaded files.
56# Example: "/home/media/media.lawrence.com/media/"
57MEDIA_ROOT = ''
58
59# URL that handles the media served from MEDIA_ROOT. Make sure to use a
60# trailing slash.
61# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
62MEDIA_URL = ''
63
64# Absolute path to the directory static files should be collected to.
65# Don't put anything in this directory yourself; store your static files
66# in apps' "static/" subdirectories and in STATICFILES_DIRS.
67# Example: "/home/media/media.lawrence.com/static/"
68STATIC_ROOT = ''
69
70# URL prefix for static files.
71# Example: "http://media.lawrence.com/static/"
72STATIC_URL = '/static/'
73
74# URL prefix for admin static files -- CSS, JavaScript and images.
75# Make sure to use a trailing slash.
76# Examples: "http://foo.com/static/admin/", "/static/admin/".
77ADMIN_MEDIA_PREFIX = '/static/admin/'
78
79# Additional locations of static files
80STATICFILES_DIRS = (
81    ()
82    # Put strings here, like "/home/html/static" or "C:/www/django/static".
83    # Always use forward slashes, even on Windows.
84    # Don't forget to use absolute paths, not relative paths.
85)
86
87# List of finder classes that know how to find static files in
88# various locations.
89STATICFILES_FINDERS = (
90    'django.contrib.staticfiles.finders.FileSystemFinder',
91    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
92#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
93)
94
95# Make this unique, and don't share it with anybody.
96SECRET_KEY = '2ttix#hi63qnw0derz&0(60&65@v=@#5gg9$9r2jw5v)nccfg+'
97
98# List of callables that know how to import templates from various sources.
99TEMPLATE_LOADERS = (
100    'django.template.loaders.filesystem.Loader',
101    'django.template.loaders.app_directories.Loader',
102#     'django.template.loaders.eggs.Loader',
103)
104
105MIDDLEWARE_CLASSES = (
106    'django.middleware.common.CommonMiddleware',
107    'django.contrib.sessions.middleware.SessionMiddleware',
108    'django.middleware.csrf.CsrfViewMiddleware',
109    'django.contrib.auth.middleware.AuthenticationMiddleware',
110    'django.contrib.messages.middleware.MessageMiddleware',
111    'molesSessionMiddleware.MolesSessionMiddleware',
112)
113ROOT_URLCONF = 'MolesManager.urls'
114
115TEMPLATE_DIRS = (
116    decodeRelativePath('static/templates')                 
117    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
118    # Always use forward slashes, even on Windows.
119    # Don't forget to use absolute paths, not relative paths.
120)
121
122INSTALLED_APPS = (
123    'django.contrib.auth',
124    'django.contrib.contenttypes',
125    'django.contrib.sessions',
126    'django.contrib.sites',
127    'django.contrib.messages',
128    'django.contrib.staticfiles',
129    'ea_model',
130    # Uncomment the next line to enable the admin:
131    # 'django.contrib.admin',
132    # Uncomment the next line to enable admin documentation:
133    # 'django.contrib.admindocs',
134        #This line defines where catch the /static/ folder
135)
136
137SITE_ROOT = DJANGO_PROJECT
138
139# A sample logging configuration. The only tangible logging
140# performed by this configuration is to send an email to
141# the site admins on every HTTP 500 error.
142# See http://docs.djangoproject.com/en/dev/topics/logging for
143# more details on how to customize your logging configuration.
144LOGGING = {
145    'version': 1,
146    'disable_existing_loggers': True,
147    'handlers': {
148        'mail_admins': {
149            'level': 'ERROR',
150            'class': 'django.utils.log.AdminEmailHandler'
151        }
152    },
153    'loggers': {
154        'django.request': {
155            'handlers': ['mail_admins'],
156            'level': 'ERROR',
157            'propagate': True,
158        }
159    }
160}
161
162#moles3 database connection
163MOLES3 = 'moles3'
164#MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
165
166MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION'
167MOLES3_DB_SCRIPT = SRC + '/sqlTables.py'
168
169
170#moles2 to moles3 migration database connection
171MIGRATION = 'migration'
172#MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName'
173
174MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION'
175MIGRATION_DB_SCRIPT = SRC + '/libs/migration/db/migrationTables.py'
176
177RUN_MIGRATION = True
Note: See TracBrowser for help on using the repository browser.