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

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

linked to Django the "outer" libraries

Line 
1# Django settings for MolesManager project.
2import os, sys
3DJANGO_ROOT = os.path.dirname(__file__)
4PROJECT_ROOT = os.path.split(DJANGO_ROOT)[0]
5sys.path.insert(0, os.path.join(PROJECT_ROOT, "ascore"))
6sys.path.insert(0, os.path.join(PROJECT_ROOT, "db_manager"))
7sys.path.insert(0, os.path.join(PROJECT_ROOT, "ea_model"))
8sys.path.insert(0, os.path.join(PROJECT_ROOT, "ea_model_tests"))
9sys.path.insert(0, os.path.join(PROJECT_ROOT, "libs"))
10
11from db_manager.dbConnection import DBConnection, DBScript
12
13DEBUG = True
14TEMPLATE_DEBUG = DEBUG
15
16ADMINS = (
17    # ('Your Name', 'your_email@example.com'),
18)
19
20MANAGERS = ADMINS
21
22DATABASES = {
23    'default': {
24        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
25        'NAME': '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlite.db',                      # Or path to database file if using sqlite3.
26        'USER': '',                      # Not used with sqlite3.
27        'PASSWORD': '',                  # Not used with sqlite3.
28        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
29        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
30    }
31}
32
33# Local time zone for this installation. Choices can be found here:
34# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
35# although not all choices may be available on all operating systems.
36# On Unix systems, a value of None will cause Django to use the same
37# timezone as the operating system.
38# If running in a Windows environment this must be set to the same as your
39# system time zone.
40TIME_ZONE = 'America/Chicago'
41
42# Language code for this installation. All choices can be found here:
43# http://www.i18nguy.com/unicode/language-identifiers.html
44LANGUAGE_CODE = 'en-us'
45
46SITE_ID = 1
47
48# If you set this to False, Django will make some optimizations so as not
49# to load the internationalization machinery.
50USE_I18N = True
51
52# If you set this to False, Django will not format dates, numbers and
53# calendars according to the current locale
54USE_L10N = True
55
56# Absolute filesystem path to the directory that will hold user-uploaded files.
57# Example: "/home/media/media.lawrence.com/media/"
58MEDIA_ROOT = ''
59
60# URL that handles the media served from MEDIA_ROOT. Make sure to use a
61# trailing slash.
62# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
63MEDIA_URL = ''
64
65# Absolute path to the directory static files should be collected to.
66# Don't put anything in this directory yourself; store your static files
67# in apps' "static/" subdirectories and in STATICFILES_DIRS.
68# Example: "/home/media/media.lawrence.com/static/"
69STATIC_ROOT = ''
70
71# URL prefix for static files.
72# Example: "http://media.lawrence.com/static/"
73STATIC_URL = '/static/'
74
75# URL prefix for admin static files -- CSS, JavaScript and images.
76# Make sure to use a trailing slash.
77# Examples: "http://foo.com/static/admin/", "/static/admin/".
78ADMIN_MEDIA_PREFIX = '/static/admin/'
79
80# Additional locations of static files
81STATICFILES_DIRS = (
82    ()
83    # Put strings here, like "/home/html/static" or "C:/www/django/static".
84    # Always use forward slashes, even on Windows.
85    # Don't forget to use absolute paths, not relative paths.
86)
87
88# List of finder classes that know how to find static files in
89# various locations.
90STATICFILES_FINDERS = (
91    'django.contrib.staticfiles.finders.FileSystemFinder',
92    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
93#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
94)
95
96# Make this unique, and don't share it with anybody.
97SECRET_KEY = '2ttix#hi63qnw0derz&0(60&65@v=@#5gg9$9r2jw5v)nccfg+'
98
99# List of callables that know how to import templates from various sources.
100TEMPLATE_LOADERS = (
101    'django.template.loaders.filesystem.Loader',
102    'django.template.loaders.app_directories.Loader',
103#     'django.template.loaders.eggs.Loader',
104)
105
106MIDDLEWARE_CLASSES = (
107    'django.middleware.common.CommonMiddleware',
108    'django.contrib.sessions.middleware.SessionMiddleware',
109    'django.middleware.csrf.CsrfViewMiddleware',
110    'django.contrib.auth.middleware.AuthenticationMiddleware',
111    'django.contrib.messages.middleware.MessageMiddleware',
112)
113
114ROOT_URLCONF = 'MolesManager.urls'
115
116TEMPLATE_DIRS = (
117    os.path.join(os.path.dirname(__file__), 'static/templates').replace('\\', '/')                 
118    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
119    # Always use forward slashes, even on Windows.
120    # Don't forget to use absolute paths, not relative paths.
121)
122
123INSTALLED_APPS = (
124    'django.contrib.auth',
125    'django.contrib.contenttypes',
126    'django.contrib.sessions',
127    'django.contrib.sites',
128    'django.contrib.messages',
129    'django.contrib.staticfiles',
130    'ea_model',
131    # Uncomment the next line to enable the admin:
132    # 'django.contrib.admin',
133    # Uncomment the next line to enable admin documentation:
134    # 'django.contrib.admindocs',
135        #This line defines where catch the /static/ folder
136)
137
138SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
139
140# A sample logging configuration. The only tangible logging
141# performed by this configuration is to send an email to
142# the site admins on every HTTP 500 error.
143# See http://docs.djangoproject.com/en/dev/topics/logging for
144# more details on how to customize your logging configuration.
145LOGGING = {
146    'version': 1,
147    'disable_existing_loggers': True,
148    'handlers': {
149        'mail_admins': {
150            'level': 'ERROR',
151            'class': 'django.utils.log.AdminEmailHandler'
152        },
153        'mmlog':{
154            'level':'DEBUG',
155            'class':'logging.FileHandler',
156            'filename': os.path.join(SITE_ROOT, 'MolesManager.log')
157        }
158    },
159    'loggers': {
160        'django.request': {
161            'handlers': ['mail_admins'],
162            'level': 'ERROR',
163            'propagate': True,
164        },
165        'myproject.custom': {
166            'handlers': ['mmlog'],
167            'level': 'DEBUG',
168            'propagate': True,
169        }
170    }
171}
172MOLES3 = 'moles3'
173MOLES2 = 'moles2'
174
175MOLES3DB_SCRIPT = '/misc/frigid3/humid1/mnagni/workspaces/moles3/MolesManager/src/sqlTables.py'
176MOLES3DB = DBConnection('postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3')
177MOLES3DB.initTables(DBScript(MOLES3DB_SCRIPT))
Note: See TracBrowser for help on using the repository browser.