Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 190 lines (157 sloc) 5.795 kb
a7b3c63 @dorey main changes for django 1.3
dorey authored
1 # Django settings for nmis project.
fb227bb @dorey moved some stuff from custom_settings into settings.
dorey authored
2 import os
3
a7b3c63 @dorey main changes for django 1.3
dorey authored
4 CURRENT_FILE = os.path.abspath(__file__)
5 PROJECT_ROOT = os.path.dirname(CURRENT_FILE)
fb227bb @dorey moved some stuff from custom_settings into settings.
dorey authored
6
a7b3c63 @dorey main changes for django 1.3
dorey authored
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9997d7c @amarder resolved conflicts in custom_settings_example.py and settings.py
amarder authored
9
a7b3c63 @dorey main changes for django 1.3
dorey authored
10 ADMINS = (
11 # ('Your Name', 'your_email@example.com'),
12 )
69d1aad @dorey I think this takes care of the problem with mongo test dbs.
dorey authored
13
a7b3c63 @dorey main changes for django 1.3
dorey authored
14 MANAGERS = ADMINS
be66fff @amarder Cleaned up settings.py around how we interact with MongoDB.
amarder authored
15
a7b3c63 @dorey main changes for django 1.3
dorey authored
16 DATABASES = {
17 'default': {
18 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
19 'NAME': 'db.sqlite3', # Or path to database file if using sqlite3.
20 }
21 }
b0aaec9 @amarder cleaned up my hack a bit, put more stuff in settings.py instead of ju…
amarder authored
22
a7b3c63 @dorey main changes for django 1.3
dorey authored
23 # Local time zone for this installation. Choices can be found here:
502f691 Changed settings to add sensible default and better overriding
ksamuel authored
24 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
a7b3c63 @dorey main changes for django 1.3
dorey authored
25 # although not all choices may be available on all operating systems.
26 # On Unix systems, a value of None will cause Django to use the same
27 # timezone as the operating system.
28 # If running in a Windows environment this must be set to the same as your
29 # system time zone.
502f691 Changed settings to add sensible default and better overriding
ksamuel authored
30 TIME_ZONE = 'America/Chicago'
982b17e @dorey Initial commit of project structure
dorey authored
31
a7b3c63 @dorey main changes for django 1.3
dorey authored
32 # Language code for this installation. All choices can be found here:
33 # http://www.i18nguy.com/unicode/language-identifiers.html
982b17e @dorey Initial commit of project structure
dorey authored
34 LANGUAGE_CODE = 'en-us'
a7b3c63 @dorey main changes for django 1.3
dorey authored
35
982b17e @dorey Initial commit of project structure
dorey authored
36 SITE_ID = 1
a7b3c63 @dorey main changes for django 1.3
dorey authored
37
38 # If you set this to False, Django will make some optimizations so as not
39 # to load the internationalization machinery.
982b17e @dorey Initial commit of project structure
dorey authored
40 USE_I18N = True
41
a7b3c63 @dorey main changes for django 1.3
dorey authored
42 # If you set this to False, Django will not format dates, numbers and
43 # calendars according to the current locale
44 USE_L10N = True
982b17e @dorey Initial commit of project structure
dorey authored
45
a7b3c63 @dorey main changes for django 1.3
dorey authored
46 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
47 # trailing slash.
48 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
49 MEDIA_URL = 'http://localhost:8000/media/'
50
51 # Absolute path to the directory static files should be collected to.
52 # Don't put anything in this directory yourself; store your static files
53 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
54 # Example: "/home/media/media.lawrence.com/static/"
55 STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
56
57 # URL prefix for static files.
58 # Example: "http://media.lawrence.com/static/"
59 STATIC_URL = '/static/'
60
61 # URL prefix for admin static files -- CSS, JavaScript and images.
62 # Make sure to use a trailing slash.
63 # Examples: "http://foo.com/static/admin/", "/static/admin/".
64 ADMIN_MEDIA_PREFIX = '/static/admin/'
65
66 # Additional locations of static files
67 STATICFILES_DIRS = (
68 # Put strings here, like "/home/html/static" or "C:/www/django/static".
69 # Always use forward slashes, even on Windows.
70 # Don't forget to use absolute paths, not relative paths.
71 )
2e17c76 @amarder added login page and started requiring users to be logged in to acces…
amarder authored
72
a7b3c63 @dorey main changes for django 1.3
dorey authored
73 # List of finder classes that know how to find static files in
74 # various locations.
75 STATICFILES_FINDERS = (
76 'django.contrib.staticfiles.finders.FileSystemFinder',
77 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
ccd8904 @dorey added stuff for "django-compressor" app (which uses sass/scss)
dorey authored
78
79 'compressor.finders.CompressorFinder',
a7b3c63 @dorey main changes for django 1.3
dorey authored
80 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
81 )
82 # Make this unique, and don't share it with anybody.
83 SECRET_KEY = 'mlfs33^s1l4xf6a36$0#j%dd*sisfoi&)&4s-v=91#^l01v)*j'
982b17e @dorey Initial commit of project structure
dorey authored
84
a7b3c63 @dorey main changes for django 1.3
dorey authored
85 # List of callables that know how to import templates from various sources.
982b17e @dorey Initial commit of project structure
dorey authored
86 TEMPLATE_LOADERS = (
87 'django.template.loaders.filesystem.Loader',
88 'django.template.loaders.app_directories.Loader',
a7b3c63 @dorey main changes for django 1.3
dorey authored
89 # 'django.template.loaders.eggs.Loader',
982b17e @dorey Initial commit of project structure
dorey authored
90 )
91
92 MIDDLEWARE_CLASSES = (
93 'django.middleware.common.CommonMiddleware',
94 'django.contrib.sessions.middleware.SessionMiddleware',
95 'django.middleware.csrf.CsrfViewMiddleware',
96 'django.contrib.auth.middleware.AuthenticationMiddleware',
97 'django.contrib.messages.middleware.MessageMiddleware',
98 )
99
100 ROOT_URLCONF = 'nmis.urls'
101
102 TEMPLATE_DIRS = (
a7b3c63 @dorey main changes for django 1.3
dorey authored
103 os.path.join(PROJECT_ROOT, 'templates')
104 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
105 # Always use forward slashes, even on Windows.
106 # Don't forget to use absolute paths, not relative paths.
982b17e @dorey Initial commit of project structure
dorey authored
107 )
108
109 INSTALLED_APPS = (
110 'django.contrib.auth',
111 'django.contrib.contenttypes',
112 'django.contrib.sessions',
113 'django.contrib.sites',
114 'django.contrib.messages',
a7b3c63 @dorey main changes for django 1.3
dorey authored
115 'django.contrib.staticfiles',
116 # Uncomment the next line to enable the admin:
12e5985 @amarder added eav to installed apps
amarder authored
117 'django.contrib.admin',
a7b3c63 @dorey main changes for django 1.3
dorey authored
118 # Uncomment the next line to enable admin documentation:
119 'django.contrib.admindocs',
120
bd6ae2c @dorey re-importing parsed_xforms to get the static content.
dorey authored
121 'parsed_xforms',
d9dbbbf @dorey added uis_r_us app and latest sammy.js (development branch)
dorey authored
122 'uis_r_us',
40bf303 @dorey added an app for saving how to display facility data (e.g. order of v…
dorey authored
123 'facility_views',
3379a49 @amarder added xform_manager to installed apps
amarder authored
124 'xform_manager',
a7b3c63 @dorey main changes for django 1.3
dorey authored
125 'phone_manager',
126 'nga_districts',
a6d54a4 @dorey brought in facilities.
dorey authored
127 'facilities',
ccd8904 @dorey added stuff for "django-compressor" app (which uses sass/scss)
dorey authored
128 'compressor',
982b17e @dorey Initial commit of project structure
dorey authored
129 )
ccd8904 @dorey added stuff for "django-compressor" app (which uses sass/scss)
dorey authored
130 COMPRESS = True
502f691 Changed settings to add sensible default and better overriding
ksamuel authored
131
a7b3c63 @dorey main changes for django 1.3
dorey authored
132 # A sample logging configuration. The only tangible logging
133 # performed by this configuration is to send an email to
134 # the site admins on every HTTP 500 error.
135 # See http://docs.djangoproject.com/en/dev/topics/logging for
136 # more details on how to customize your logging configuration.
137 LOGGING = {
138 'version': 1,
139 'disable_existing_loggers': False,
140 'handlers': {
141 'mail_admins': {
142 'level': 'ERROR',
143 'class': 'django.utils.log.AdminEmailHandler'
144 }
145 },
146 'loggers': {
147 'django.request': {
148 'handlers': ['mail_admins'],
149 'level': 'ERROR',
150 'propagate': True,
151 },
152 }
153 }
154
155
156 import sys
157
158 SITE_TITLE = "Baseline Data Collection"
159
ccd8904 @dorey added stuff for "django-compressor" app (which uses sass/scss)
dorey authored
160 COMPILER_FORMATS = {
161 '.sass': {
162 'binary_path': 'sass',
163 'arguments': '*.sass *.css'
164 },
165 '.scss': {
166 'binary_path': 'sass',
167 'arguments': '*.scss *.css'
168 }
169 }
170
a7b3c63 @dorey main changes for django 1.3
dorey authored
171 TESTING_MODE = False
172 if len(sys.argv)>=2 and (sys.argv[1]=="test" or sys.argv[1]=="test_all"):
173 # This trick works only when we run tests from the command line.
174 TESTING_MODE = True
175 else:
176 TESTING_MODE = False
177
178 # Clear out the test database
179 if TESTING_MODE:
180 MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'test_static/')
181 else:
182 MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'static/')
60ebfea @amarder Added import from local_settings to override default settings.
amarder authored
183
184
185 try:
186 from local_settings import *
187 except ImportError:
188 print("You can override the default settings by adding a "
189 "local_settings.py file.")
Something went wrong with that request. Please try again.