Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 273 lines (226 sloc) 8.54 kb
84ce8f4 @ialbert large refactoring
authored
1 #
2 # default setting for the development server
3 # modify these settings for any publicly facing website
4 #
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
5 import os, sys, re
4649ec5 @ialbert first commit, initializing the project
authored
6
84ce8f4 @ialbert large refactoring
authored
7 # on deployed servers make this unique, and don't share it with anybody.
8 SECRET_KEY = '007'
9
f6dc3b4 @ialbert replacing the permission system
authored
10 # the minimal reputation needed for a user to ask new questions
11 MINIMUM_REPUTATION = 0
12
13 # the number of posts a new user may make in a single day
14 NEWBIE_MAX_POSTS_PER_DAY = 3
15
84ce8f4 @ialbert large refactoring
authored
16 # turn off debug mode on deployed servers
4649ec5 @ialbert first commit, initializing the project
authored
17 DEBUG = True
84ce8f4 @ialbert large refactoring
authored
18
19 # template debug mode
4649ec5 @ialbert first commit, initializing the project
authored
20 TEMPLATE_DEBUG = DEBUG
21
84ce8f4 @ialbert large refactoring
authored
22 # admin site may fail if this setting is active
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
23 TEMPLATE_STRING_IF_INVALID = "*** MISSING ***"
51a3c0e @ialbert work on testing framework, added TEST_MODE flag, automated testuser l…
authored
24
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
25 ADMINS = (
4484b51 @ialbert refactored functionality for adding files into the site as posts
authored
26 ('Default Admin', 'your-mail-here@your-server-here.com'),
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
27 )
28
29 MANAGERS = ADMINS
90b4392 @pindia Add SQL query counter in the footer (only in debug mode and from loca…
pindia authored
30
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
31 def path(*args):
4649ec5 @ialbert first commit, initializing the project
authored
32 "Generates absolute paths"
33 return os.path.abspath(os.path.join(*args))
34
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
35 # displays debug comments when the server is run from this IP
36 INTERNAL_IPS = ('127.0.0.1', )
37
4649ec5 @ialbert first commit, initializing the project
authored
38 # the directory that this file is located in
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
39 __CURR_DIR = path(os.path.dirname(__file__))
4649ec5 @ialbert first commit, initializing the project
authored
40
84ce8f4 @ialbert large refactoring
authored
41 # set location relative to the current file directory
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
42 HOME_DIR = path(__CURR_DIR )
43 DATABASE_DIR = path(HOME_DIR, 'db')
44 DATABASE_NAME = path(DATABASE_DIR, 'biostar.db')
18010c1 @ialbert moved templates under the application directory, to separate it from …
authored
45 TEMPLATE_DIR = path(HOME_DIR, 'main', 'templates')
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
46 STATIC_DIR = path(HOME_DIR, 'static')
84ce8f4 @ialbert large refactoring
authored
47 EXPORT_DIR = path(HOME_DIR, '..', 'export')
842c0b0 @ialbert adding text search
authored
48 WHOOSH_INDEX = path(HOME_DIR, 'db', 'index')
fe755a8 @ialbert work on planet refresh
authored
49 PLANET_DIR = path(HOME_DIR, 'db', 'planet')
4649ec5 @ialbert first commit, initializing the project
authored
50
51 DATABASES = {
52 'default': {
53 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
3ff57cd @ialbert added a number of functional tests, small edits for code formatting, …
authored
54 'NAME': DATABASE_NAME, # Or path to database file if using sqlite3.
4649ec5 @ialbert first commit, initializing the project
authored
55 'USER': '', # Not used with sqlite3.
56 'PASSWORD': '', # Not used with sqlite3.
57 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
58 'PORT': '', # Set to empty string for default. Not used with sqlite3.
59 }
60 }
61
e593a47 @ialbert work on account merge email
authored
62 # email specific settings
63 EMAIL_HOST = 'smtp.yourserver.com'
64 EMAIL_HOST_USER = 'user'
65 EMAIL_HOST_PASSWORD = 'password'
66 DEFAULT_FROM_EMAIL = 'default'
67 SERVER_EMAIL = 'default'
68
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
69 # add external dependecies
70 __ZIP_LIBS = [
9f50e07 @ialbert modified openid library to override empty names
authored
71 path(__CURR_DIR, '..', 'libs'),
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
72 path(__CURR_DIR, '..', 'libs', 'libraries.zip'),
73 ]
74 sys.path.extend(__ZIP_LIBS)
75
4649ec5 @ialbert first commit, initializing the project
authored
76 # Local time zone for this installation. Choices can be found here:
77 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
78 # although not all choices may be available on all operating systems.
79 # On Unix systems, a value of None will cause Django to use the same
80 # timezone as the operating system.
81 # If running in a Windows environment this must be set to the same as your
82 # system time zone.
83 TIME_ZONE = 'America/Chicago'
84
85 # Language code for this installation. All choices can be found here:
86 # http://www.i18nguy.com/unicode/language-identifiers.html
87 LANGUAGE_CODE = 'en-us'
88
89 SITE_ID = 1
90
3fa175b @ialbert added account merging
authored
91 # the dommain for this site
92 SITE_DOMAIN = 'localhost:8080'
93
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
94 # added a custom test runner
91800cb @ialbert adding back tests one at a time
authored
95 TEST_RUNNER='server.tests.runner.BiostarTest'
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
96
4649ec5 @ialbert first commit, initializing the project
authored
97 # If you set this to False, Django will make some optimizations so as not
98 # to load the internationalization machinery.
99 USE_I18N = True
100
101 # If you set this to False, Django will not format dates, numbers and
102 # calendars according to the current locale
103 USE_L10N = True
104
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
105 # Absolute filesystem path to the directory that will hold user-uploaded files.
106 # Example: "/home/media/media.lawrence.com/media/"
1eba97c @ialbert updated dependency to django 1.4
authored
107 MEDIA_ROOT = "."
4649ec5 @ialbert first commit, initializing the project
authored
108
109 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
110 # trailing slash.
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
111 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
1eba97c @ialbert updated dependency to django 1.4
authored
112 MEDIA_URL = "/"
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
113
114 # Absolute path to the directory static files should be collected to.
115 # Don't put anything in this directory yourself; store your static files
116 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
117 # Example: "/home/media/media.lawrence.com/static/"
84ce8f4 @ialbert large refactoring
authored
118 STATIC_ROOT = EXPORT_DIR
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
119
120 # URL prefix for static files.
121 # Example: "http://media.lawrence.com/static/"
84ce8f4 @ialbert large refactoring
authored
122 STATIC_URL = '/static/'
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
123
124 # Additional locations of static files
125 STATICFILES_DIRS = (
126 # Put strings here, like "/home/html/static" or "C:/www/django/static".
127 # Always use forward slashes, even on Windows.
128 # Don't forget to use absolute paths, not relative paths.
84ce8f4 @ialbert large refactoring
authored
129 STATIC_DIR,
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
130 )
131
132 # List of finder classes that know how to find static files in
133 # various locations.
134 STATICFILES_FINDERS = (
135 'django.contrib.staticfiles.finders.FileSystemFinder',
136 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
137 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
138 )
139
4649ec5 @ialbert first commit, initializing the project
authored
140 # List of callables that know how to import templates from various sources.
141 TEMPLATE_LOADERS = (
142 'django.template.loaders.filesystem.Loader',
143 'django.template.loaders.app_directories.Loader',
144 # 'django.template.loaders.eggs.Loader',
145 )
146
147 MIDDLEWARE_CLASSES = (
148 'django.middleware.common.CommonMiddleware',
149 'django.contrib.sessions.middleware.SessionMiddleware',
150 'django.middleware.csrf.CsrfViewMiddleware',
151 'django.contrib.auth.middleware.AuthenticationMiddleware',
152 'django.contrib.messages.middleware.MessageMiddleware',
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
153 'main.middleware.LastVisit',
154 'main.middleware.PermissionsMiddleware'
155 )
156
72e9ed4 @ialbert new tag handlers, caching added
authored
157 CACHES = {
158 'default': {
159 'BACKEND': 'django.core.cache.backends.dummy.DummyCache' if DEBUG else 'django.core.cache.backends.locmem.LocMemCache',
0cd3270 @ialbert adding new post indicators to tabs
authored
160 #'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
72e9ed4 @ialbert new tag handlers, caching added
authored
161 'LOCATION': 'unique-snowflake'
162 }
163 }
164
0cd3270 @ialbert adding new post indicators to tabs
authored
165 #SESSION_ENGINE = "django.contrib.sessions.backends.cache"
166
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
167 ROOT_URLCONF = 'main.urls'
168
169 TEMPLATE_DIRS = (
170 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
171 # Always use forward slashes, even on Windows.
172 # Don't forget to use absolute paths, not relative paths.
173 TEMPLATE_DIR,
4649ec5 @ialbert first commit, initializing the project
authored
174 )
175
7a6a4d6 @ialbert moved version tag into an environment variable
authored
176 TEMPLATE_CONTEXT_PROCESSORS = (
177 "django.contrib.auth.context_processors.auth",
2a4182c @pindia Restore the "debug" context processor, a default that was overriden
pindia authored
178 "django.core.context_processors.debug",
2b66bb9 @pindia Highlight navigation item the user is currently at.
pindia authored
179 'django.core.context_processors.request',
84ce8f4 @ialbert large refactoring
authored
180 'django.core.context_processors.static',
255ea80 @ialbert added more generic OpenID merging of accounts
authored
181 'django.contrib.messages.context_processors.messages',
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
182 "main.context.extras",
72e9ed4 @ialbert new tag handlers, caching added
authored
183 "main.context.popular_tags"
7a6a4d6 @ialbert moved version tag into an environment variable
authored
184 )
185
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
186 AUTH_PROFILE_MODULE = "server.UserProfile"
4649ec5 @ialbert first commit, initializing the project
authored
187
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
188 ROOT_URLCONF = 'main.urls'
4649ec5 @ialbert first commit, initializing the project
authored
189
b609301 @ialbert enabled OpenID login
authored
190 AUTHENTICATION_BACKENDS = (
191 'django_openid_auth.auth.OpenIDBackend',
192 'django.contrib.auth.backends.ModelBackend',
193 )
194
195 OPENID_CREATE_USERS = True
7311b85 @ialbert fix for openid login closes #78
authored
196 OPENID_UPDATE_DETAILS_FROM_SREG = False
8936f73 @ialbert enabled the markitup editor for editing questions and answers
authored
197 OPENID_USE_AS_ADMIN_LOGIN = True
b609301 @ialbert enabled OpenID login
authored
198
16532a9 @ialbert readme fixes
authored
199 # allow migration based on user email
cee28d1 @ialbert closes 67, closes 68, closes 69
authored
200 ALLOW_OPENID_MIGRATION = True
16532a9 @ialbert readme fixes
authored
201
b609301 @ialbert enabled OpenID login
authored
202 LOGIN_URL = '/openid/login/'
203 LOGIN_REDIRECT_URL = '/'
204
4649ec5 @ialbert first commit, initializing the project
authored
205 INSTALLED_APPS = (
206 'django.contrib.auth',
207 'django.contrib.contenttypes',
208 'django.contrib.sessions',
209 'django.contrib.sites',
210 'django.contrib.messages',
84ce8f4 @ialbert large refactoring
authored
211 'django.contrib.staticfiles',
255ea80 @ialbert added more generic OpenID merging of accounts
authored
212 'django.contrib.humanize',
26f8146 @ialbert added markdown to user profile
authored
213 'django.contrib.markup',
0440105 @ialbert renamed files, added notification system
authored
214 'django.contrib.messages',
4649ec5 @ialbert first commit, initializing the project
authored
215 # Uncomment the next line to enable the admin:
216 'django.contrib.admin',
217 # Uncomment the next line to enable admin documentation:
255ea80 @ialbert added more generic OpenID merging of accounts
authored
218 'django.contrib.admindocs',
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
219 'main.server',
b609301 @ialbert enabled OpenID login
authored
220 'django_openid_auth',
4649ec5 @ialbert first commit, initializing the project
authored
221 )
222
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
223 # A sample logging configuration. The only tangible logging
224 # performed by this configuration is to send an email to
225 # the site admins on every HTTP 500 error.
226 # See http://docs.djangoproject.com/en/dev/topics/logging for
227 # more details on how to customize your logging configuration.
af65c0d @ialbert added log configuration
authored
228
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
229 LOGGING = {
230 'version': 1,
231 'disable_existing_loggers': False,
af65c0d @ialbert added log configuration
authored
232 'formatters': {
233 'simple': {
234 'format': '%(levelname)s\t%(name)s\t%(funcName)s\t%(asctime)s \t%(message)s'
235 },
236 },
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
237 'handlers': {
af65c0d @ialbert added log configuration
authored
238 'console':{
239 'level':'DEBUG',
240 'class':'logging.StreamHandler',
241 'formatter': 'simple'
242 },
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
243 },
244 'loggers': {
af65c0d @ialbert added log configuration
authored
245 'main.server.views': {
246 'handlers': [ 'console' ],
247 'level': 'INFO',
177f0af @ialbert all tests pass, getting ready for 2nd beta
authored
248 },
e593a47 @ialbert work on account merge email
authored
249 'main.server.action': {
250 'handlers': [ 'console' ],
251 'level': 'INFO',
252 },
177f0af @ialbert all tests pass, getting ready for 2nd beta
authored
253 'main.server.auth': {
254 'handlers': [ 'console' ],
255 'level': 'INFO',
256 },
257 'main.server.models': {
258 'handlers': [ 'console' ],
259 'level': 'INFO',
af65c0d @ialbert added log configuration
authored
260 }
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
261 }
262 }
263
fe362ef @ialbert typo
authored
264 GOOGLE_TRACKER = "ABCD"
d16778b @ialbert enabled google tracker on the main template
authored
265
ee1cb2d @ialbert more work on toggling the indexing
authored
266 # needs to be turned on explicitly
267 CONTENT_INDEXING = False
268
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
269 # version check, we can do it at the end since
270 # the version is only required in subsequent modules
4649ec5 @ialbert first commit, initializing the project
authored
271 if sys.version_info < (2, 6):
272 sys.stderr.write( '*** this code requires python 2.6 or higher ***' )
b990377 @ialbert massive refactoring, moving things around, duck and cover!
authored
273 sys.exit()
Something went wrong with that request. Please try again.