1 # Django settings for mygpo project.
3 # This file is part of my.gpodder.org.
5 # my.gpodder.org is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or (at your
8 # option) any later version.
10 # my.gpodder.org is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
13 # License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with my.gpodder.org. If not, see <http://www.gnu.org/licenses/>.
21 BASE_DIR
= os
.path
.dirname(os
.path
.abspath(__file__
))
23 # http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined
27 TEMPLATE_DEBUG
= DEBUG
34 # not needed for production, but tests fail otherwise in Django 1.4
37 'ENGINE': 'django.db.backends.sqlite3',
43 ('mygpo.directory', 'http://127.0.0.1:5984/mygpo'),
44 ('mygpo.core', 'http://127.0.0.1:5984/mygpo'),
45 ('mygpo.users', 'http://127.0.0.1:5984/mygpo'),
46 ('mygpo.share', 'http://127.0.0.1:5984/mygpo'),
47 ('mygpo.maintenance', 'http://127.0.0.1:5984/mygpo'),
48 ('django_couchdb_utils_auth', 'http://127.0.0.1:5984/mygpo'),
49 ('django_couchdb_utils_sessions', 'http://127.0.0.1:5984/mygpo_sessions'),
50 ('django_couchdb_utils_registration', 'http://127.0.0.1:5984/mygpo'),
54 # Local time zone for this installation. Choices can be found here:
55 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
56 # although not all choices may be available on all operating systems.
57 # If running in a Windows environment this must be set to the same as your
61 # Language code for this installation. All choices can be found here:
62 # http://www.i18nguy.com/unicode/language-identifiers.html
63 LANGUAGE_CODE
= 'en-us'
67 # If you set this to False, Django will make some optimizations so as not
68 # to load the internationalization machinery.
71 # Absolute path to the directory that holds media.
72 # Example: "/home/media/media.lawrence.com/"
73 MEDIA_ROOT
= os
.path
.abspath('%s/../htdocs/media/' % os
.path
.dirname(__file__
))
75 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
76 # trailing slash if there is a path component (optional in other cases).
77 # Examples: "http://media.lawrence.com", "http://example.com/media/"
80 # List of callables that know how to import templates from various sources.
82 'django.template.loaders.app_directories.Loader',
85 MIDDLEWARE_CLASSES
= (
86 'django.middleware.cache.UpdateCacheMiddleware',
87 'django.middleware.common.CommonMiddleware',
88 'django.middleware.csrf.CsrfViewMiddleware',
89 'django.middleware.cache.FetchFromCacheMiddleware',
90 'django.contrib.sessions.middleware.SessionMiddleware',
91 'django.contrib.auth.middleware.AuthenticationMiddleware',
92 'django.middleware.locale.LocaleMiddleware',
93 'django.contrib.messages.middleware.MessageMiddleware',
96 ROOT_URLCONF
= 'mygpo.urls'
101 'django.contrib.contenttypes', # unused, but tests fail otherwise (?)
102 'django.contrib.messages',
103 'django.contrib.humanize',
104 'couchdbkit.ext.django',
105 'django_couchdb_utils.auth',
106 'django_couchdb_utils.sessions',
107 'django_couchdb_utils.registration',
127 TEST_RUNNER
='mygpo.test.MygpoTestSuiteRunner'
129 ACCOUNT_ACTIVATION_DAYS
= 7
131 AUTHENTICATION_BACKENDS
= (
132 'django_couchdb_utils.auth.backends.CouchDBAuthBackend',
133 'mygpo.web.auth.EmailAuthenticationBackend',
136 SESSION_ENGINE
= "django_couchdb_utils.sessions.cached_couchdb"
138 TEMPLATE_CONTEXT_PROCESSORS
= (
139 "django.contrib.auth.context_processors.auth",
140 "django.core.context_processors.debug",
141 "django.core.context_processors.i18n",
142 "django.core.context_processors.media",
143 "django.contrib.messages.context_processors.messages",
144 "mygpo.web.google.analytics",
145 "mygpo.web.google.adsense",
148 MESSAGE_STORAGE
= 'django.contrib.messages.storage.session.SessionStorage'
150 USER_CLASS
= 'mygpo.users.models.User'
152 AUTH_PROFILE_MODULE
= "api.UserProfile"
155 LOGIN_URL
= '/login/'
157 CSRF_FAILURE_VIEW
='mygpo.web.views.security.csrf_failure'
160 # The following entries should be set in settings_prod.py
161 DEFAULT_FROM_EMAIL
= ''
163 GOOGLE_ANALYTICS_PROPERTY_ID
=''
164 DIRECTORY_EXCLUDED_TAGS
= ()
167 MAINTENANCE
= os
.path
.exists(os
.path
.join(BASE_DIR
, 'MAINTENANCE'))
169 EMAIL_BACKEND
= 'django_couchdb_utils.email.backends.CouchDBEmailBackend'
171 # minimum number of subscribers a podcast must have to be assigned a slug
172 PODCAST_SLUG_SUBSCRIBER_LIMIT
= 10
176 ADSENSE_SLOT_BOTTOM
= ''
178 # enabled access to staff-only areas with ?staff=<STAFF_TOKEN>
183 from settings_prod
import *
184 except ImportError, e
:
186 print >> sys
.stderr
, 'create settings_prod.py with your customized settings'