1 | # Django settings for MolesManager project. |
---|
2 | import os |
---|
3 | |
---|
4 | def decodeRelativePath(relPath): |
---|
5 | return os.path.join(os.path.dirname(__file__), relPath).replace('\\', '/') |
---|
6 | |
---|
7 | DJANGO_PROJECT = os.path.dirname(decodeRelativePath('')) |
---|
8 | SRC = os.path.dirname(DJANGO_PROJECT) |
---|
9 | PROJECT = os.path.dirname(SRC) |
---|
10 | |
---|
11 | |
---|
12 | DEBUG = True |
---|
13 | TEMPLATE_DEBUG = DEBUG |
---|
14 | |
---|
15 | ADMINS = ( |
---|
16 | # ('Your Name', 'your_email@example.com'), |
---|
17 | ) |
---|
18 | |
---|
19 | PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__)) |
---|
20 | |
---|
21 | PROJECT_DIRNAME = PROJECT_ROOT.split(os.sep)[-1] |
---|
22 | |
---|
23 | |
---|
24 | MANAGERS = ADMINS |
---|
25 | |
---|
26 | DATABASES = { |
---|
27 | 'default': { |
---|
28 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
---|
29 | 'NAME': '/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. |
---|
44 | TIME_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 |
---|
48 | LANGUAGE_CODE = 'en-us' |
---|
49 | |
---|
50 | SITE_ID = 1 |
---|
51 | |
---|
52 | # If you set this to False, Django will make some optimizations so as not |
---|
53 | # to load the internationalization machinery. |
---|
54 | USE_I18N = True |
---|
55 | |
---|
56 | # If you set this to False, Django will not format dates, numbers and |
---|
57 | # calendars according to the current locale |
---|
58 | USE_L10N = True |
---|
59 | |
---|
60 | # Absolute filesystem path to the directory that will hold user-uploaded files. |
---|
61 | # Example: "/home/media/media.lawrence.com/media/" |
---|
62 | MEDIA_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/" |
---|
68 | MEDIA_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/" subdirectories 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/" |
---|
78 | |
---|
79 | #Deployment parametrized version |
---|
80 | STATIC_URL = 'http://localhost' |
---|
81 | |
---|
82 | # URL prefix for admin static files -- CSS, JavaScript and images. |
---|
83 | # Make sure to use a trailing slash. |
---|
84 | # Examples: "http://foo.com/static/admin/", "/static/admin/". |
---|
85 | ADMIN_MEDIA_PREFIX = '/static/admin/' |
---|
86 | |
---|
87 | # Additional locations of static files |
---|
88 | STATICFILES_DIRS = ( |
---|
89 | () |
---|
90 | # Put strings here, like "/home/html/static" or "C:/www/django/static". |
---|
91 | # Always use forward slashes, even on Windows. |
---|
92 | # Don't forget to use absolute paths, not relative paths. |
---|
93 | ) |
---|
94 | |
---|
95 | # List of finder classes that know how to find static files in |
---|
96 | # various locations. |
---|
97 | STATICFILES_FINDERS = ( |
---|
98 | 'django.contrib.staticfiles.finders.FileSystemFinder', |
---|
99 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
---|
100 | 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
---|
101 | ) |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | # Make this unique, and don't share it with anybody. |
---|
107 | SECRET_KEY = '2ttix#hi63qnw0derz&0(60&65@v=@#5gg9$9r2jw5v)nccfg+' |
---|
108 | |
---|
109 | # List of callables that know how to import templates from various sources. |
---|
110 | TEMPLATE_LOADERS = ( |
---|
111 | 'django.template.loaders.filesystem.Loader', |
---|
112 | 'django.template.loaders.app_directories.Loader', |
---|
113 | # 'django.template.loaders.eggs.Loader', |
---|
114 | ) |
---|
115 | |
---|
116 | |
---|
117 | |
---|
118 | MIDDLEWARE_CLASSES = ( |
---|
119 | 'django.middleware.common.CommonMiddleware', |
---|
120 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
121 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
122 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
123 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
124 | 'molesSessionMiddleware.MolesSessionMiddleware', |
---|
125 | ) |
---|
126 | ROOT_URLCONF = 'MolesManager.urls' |
---|
127 | |
---|
128 | TEMPLATE_CONTEXT_PROCESSORS = ( |
---|
129 | "django.contrib.auth.context_processors.auth", |
---|
130 | "django.core.context_processors.debug", |
---|
131 | "django.core.context_processors.i18n", |
---|
132 | "django.core.context_processors.media", |
---|
133 | "django.core.context_processors.request", |
---|
134 | "django.core.context_processors.static", |
---|
135 | ) |
---|
136 | |
---|
137 | |
---|
138 | TEMPLATE_DIRS = ( |
---|
139 | decodeRelativePath('static/templates') |
---|
140 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
141 | # Always use forward slashes, even on Windows. |
---|
142 | # Don't forget to use absolute paths, not relative paths. |
---|
143 | ) |
---|
144 | |
---|
145 | INSTALLED_APPS = ( |
---|
146 | 'django.contrib.auth', |
---|
147 | 'django.contrib.contenttypes', |
---|
148 | 'django.contrib.sessions', |
---|
149 | 'django.contrib.sites', |
---|
150 | 'django.contrib.messages', |
---|
151 | 'django.contrib.staticfiles', |
---|
152 | 'ea_model', |
---|
153 | # Uncomment the next line to enable the admin: |
---|
154 | # 'django.contrib.admin', |
---|
155 | # Uncomment the next line to enable admin documentation: |
---|
156 | # 'django.contrib.admindocs', |
---|
157 | #This line defines where catch the /static/ folder |
---|
158 | ) |
---|
159 | |
---|
160 | SITE_ROOT = DJANGO_PROJECT |
---|
161 | |
---|
162 | # A sample logging configuration. The only tangible logging |
---|
163 | # performed by this configuration is to send an email to |
---|
164 | # the site admins on every HTTP 500 error. |
---|
165 | # See http://docs.djangoproject.com/en/dev/topics/logging for |
---|
166 | # more details on how to customize your logging configuration. |
---|
167 | LOGGING = { |
---|
168 | 'version': 1, |
---|
169 | 'disable_existing_loggers': True, |
---|
170 | 'handlers': { |
---|
171 | 'mail_admins': { |
---|
172 | 'level': 'ERROR', |
---|
173 | 'class': 'django.utils.log.AdminEmailHandler' |
---|
174 | } |
---|
175 | }, |
---|
176 | 'loggers': { |
---|
177 | 'django.request': { |
---|
178 | 'handlers': ['mail_admins'], |
---|
179 | 'level': 'ERROR', |
---|
180 | 'propagate': True, |
---|
181 | } |
---|
182 | } |
---|
183 | } |
---|
184 | |
---|
185 | #moles3 database connection |
---|
186 | MOLES3 = 'moles3' |
---|
187 | #MOLES3_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' |
---|
188 | MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' |
---|
189 | from sqlTables import doTables as doMoles |
---|
190 | MOLES3_DB_SCRIPT = doMoles |
---|
191 | |
---|
192 | |
---|
193 | #moles2 to moles3 migration database connection |
---|
194 | MIGRATION = 'migration' |
---|
195 | #MIGRATION_DB_CONNECTION = 'postgresql://user:pws@host:port/dbName' |
---|
196 | |
---|
197 | MIGRATION_DB_CONNECTION = 'PG_MIGRATION_DB_CONNECTION' |
---|
198 | from libs.migration.db.migrationTables import doTables as doMigration |
---|
199 | MIGRATION_DB_SCRIPT = doMigration |
---|
200 | |
---|
201 | RUN_MIGRATION = True |
---|
202 | #Default to one day |
---|
203 | MIGRATION_INTERVAL = 86400 |
---|