remove unused AUTH_PROFILE_MODULE setting
[mygpo.git] / mygpo / settings.py
blob049f787485007d2868a35c111519bed722926b61
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/>.
19 import os.path
21 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
23 # http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#ChangedthewayURLpathsaredetermined
24 FORCE_SCRIPT_NAME=""
26 DEBUG = True
27 TEMPLATE_DEBUG = DEBUG
29 ADMINS = ()
31 MANAGERS = ADMINS
33 # dummy entry.
34 # not needed for production, but tests fail otherwise in Django 1.4
35 DATABASES = {
36 'default': {
37 'ENGINE': 'django.db.backends.sqlite3',
38 'NAME': 'tmp',
42 COUCHDB_DATABASES = {
43 'mygpo.directory':
44 {'URL': 'http://127.0.0.1:5984/mygpo'},
46 'mygpo.core':
47 {'URL': 'http://127.0.0.1:5984/mygpo'},
49 'mygpo.api':
50 {'URL': 'http://127.0.0.1:5984/mygpo'},
52 'mygpo.users':
53 {'URL': 'http://127.0.0.1:5984/mygpo'},
55 'mygpo.share':
56 {'URL': 'http://127.0.0.1:5984/mygpo'},
58 'mygpo.maintenance':
59 {'URL': 'http://127.0.0.1:5984/mygpo'},
61 'mygpo.pubsub':
62 {'URL': 'http://127.0.0.1:5984/mygpo_pubsub'},
64 'django_couchdb_utils_auth':
65 {'URL': 'http://127.0.0.1:5984/mygpo'},
67 'django_couchdb_utils_sessions':
68 {'URL': 'http://127.0.0.1:5984/mygpo_sessions'},
70 'django_couchdb_utils_registration':
71 {'URL': 'http://127.0.0.1:5984/mygpo'},
73 'mygpo.categories':
74 {'URL': 'http://127.0.0.1:5984/mygpo_categories'},
77 # Maps design documents to databases. The keys correspond to the directories in
78 # mygpo/couch/, the values are the app labels which are mapped to the actual
79 # databases in COUCHDB_DATABASES. This indirect mapping is used because
80 # COUCHDB_DATABASES is likely to be overwritten in settings_prod.py while
81 # COUCHDB_DDOC_MAPPING is most probably not overwritten.
82 COUCHDB_DDOC_MAPPING = {
83 'general': 'core',
84 'categories': 'categories',
85 'pubsub': 'pubsub',
88 # Local time zone for this installation. Choices can be found here:
89 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
90 # although not all choices may be available on all operating systems.
91 # If running in a Windows environment this must be set to the same as your
92 # system time zone.
93 TIME_ZONE = 'UTC'
95 # Language code for this installation. All choices can be found here:
96 # http://www.i18nguy.com/unicode/language-identifiers.html
97 LANGUAGE_CODE = 'en-us'
99 SITE_ID = 1
101 # If you set this to False, Django will make some optimizations so as not
102 # to load the internationalization machinery.
103 USE_I18N = True
105 # Absolute path to the directory that holds media.
106 # Example: "/home/media/media.lawrence.com/"
107 MEDIA_ROOT = os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__))
109 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
110 # trailing slash if there is a path component (optional in other cases).
111 # Examples: "http://media.lawrence.com", "http://example.com/media/"
112 MEDIA_URL = ''
114 # List of callables that know how to import templates from various sources.
115 TEMPLATE_LOADERS = (
116 'django.template.loaders.app_directories.Loader',
119 MIDDLEWARE_CLASSES = (
120 'django.middleware.cache.UpdateCacheMiddleware',
121 'django.middleware.common.CommonMiddleware',
122 'django.middleware.csrf.CsrfViewMiddleware',
123 'django.middleware.cache.FetchFromCacheMiddleware',
124 'django.contrib.sessions.middleware.SessionMiddleware',
125 'django.contrib.auth.middleware.AuthenticationMiddleware',
126 'django.middleware.locale.LocaleMiddleware',
127 'django.contrib.messages.middleware.MessageMiddleware',
130 ROOT_URLCONF = 'mygpo.urls'
132 TEMPLATE_DIRS = ()
134 INSTALLED_APPS = (
135 'django.contrib.contenttypes', # unused, but tests fail otherwise (?)
136 'django.contrib.messages',
137 'django.contrib.humanize',
138 'couchdbkit.ext.django',
139 'django_couchdb_utils.auth',
140 'django_couchdb_utils.sessions',
141 'django_couchdb_utils.registration',
142 'mygpo.core',
143 'mygpo.users',
144 'mygpo.api',
145 'mygpo.web',
146 'mygpo.publisher',
147 'mygpo.data',
148 'mygpo.userfeeds',
149 'mygpo.directory',
150 'mygpo.maintenance',
151 'mygpo.share',
152 'mygpo.admin',
153 'mygpo.pubsub',
154 'mygpo.db.couchdb',
157 TEST_EXCLUDE = (
158 'django',
159 'couchdbkit',
162 TEST_RUNNER='mygpo.test.MygpoTestSuiteRunner'
164 ACCOUNT_ACTIVATION_DAYS = 7
166 AUTHENTICATION_BACKENDS = (
167 'django_couchdb_utils.auth.backends.CouchDBAuthBackend',
168 'mygpo.web.auth.EmailAuthenticationBackend',
171 SESSION_ENGINE = "django_couchdb_utils.sessions.cached_couchdb"
173 TEMPLATE_CONTEXT_PROCESSORS = (
174 "django.contrib.auth.context_processors.auth",
175 "django.core.context_processors.debug",
176 "django.core.context_processors.i18n",
177 "django.core.context_processors.media",
178 "django.contrib.messages.context_processors.messages",
179 "mygpo.web.google.analytics",
180 "mygpo.web.google.adsense",
183 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
185 USER_CLASS = 'mygpo.users.models.User'
187 LOGIN_URL = '/login/'
189 CSRF_FAILURE_VIEW='mygpo.web.views.security.csrf_failure'
192 # The following entries should be set in settings_prod.py
193 DEFAULT_FROM_EMAIL = ''
194 SECRET_KEY = ''
195 GOOGLE_ANALYTICS_PROPERTY_ID=''
196 DIRECTORY_EXCLUDED_TAGS = ()
197 FLICKR_API_KEY = ''
199 MAINTENANCE = os.path.exists(os.path.join(BASE_DIR, 'MAINTENANCE'))
201 EMAIL_BACKEND = 'django_couchdb_utils.email.backends.CouchDBEmailBackend'
204 LOGGING = {
205 'version': 1,
206 'disable_existing_loggers': True,
207 'formatters': {
208 'verbose': {
209 'format': '%(asctime)s %(name)s %(levelname)s %(message)s',
212 'filters': {
213 'require_debug_false': {
214 '()': 'django.utils.log.RequireDebugFalse'
217 'handlers': {
218 'console':{
219 'level': 'DEBUG',
220 'class': 'logging.StreamHandler',
221 'formatter': 'verbose'
223 'mail_admins': {
224 'level': 'ERROR',
225 'filters': ['require_debug_false'],
226 'class': 'django.utils.log.AdminEmailHandler'
229 'loggers': {
230 'django': {
231 'handlers': ['console'],
232 'propagate': True,
233 'level': 'WARN',
235 'mygpo': {
236 'handlers': ['console'],
237 'level': 'INFO',
242 # minimum number of subscribers a podcast must have to be assigned a slug
243 PODCAST_SLUG_SUBSCRIBER_LIMIT = 10
245 # minimum number of subscribers that a podcast needs to "push" one of its
246 # categories to the top
247 MIN_SUBSCRIBERS_CATEGORY=10
249 # maximum number of episode actions that the API processes immediatelly before
250 # returning the response. Larger requests will be handled in background.
251 # Handler can be set to None to disable
252 API_ACTIONS_MAX_NONBG=100
253 API_ACTIONS_BG_HANDLER='mygpo.api.tasks.episode_actions_celery_handler'
256 ADSENSE_CLIENT = ''
257 ADSENSE_SLOT_BOTTOM = ''
259 # enabled access to staff-only areas with ?staff=<STAFF_TOKEN>
260 STAFF_TOKEN = None
262 # Flattr settings -- available after you register your app
263 FLATTR_KEY = ''
264 FLATTR_SECRET = ''
266 # Flattr thing of the webservice. Will be flattr'd when a user sets the "Auto-Flattr gpodder.net" option
267 FLATTR_MYGPO_THING='https://flattr.com/submit/auto?user_id=stefankoegl&url=http://gpodder.net'
269 # The User-Agent string used for outgoing HTTP requests
270 USER_AGENT = 'gpodder.net (+https://github.com/gpodder/mygpo)'
272 # Base URL of the website that is used if the actually used parameters is not
273 # available. Request handlers, for example, can access the requested domain.
274 # Code that runs in background can not do this, and therefore requires a
275 # default value. This should be set to something like 'http://example.com'
276 DEFAULT_BASE_URL = ''
279 ### Celery
281 BROKER_URL='redis://localhost'
282 BACKEND_URL='redis://localhost'
285 # a dictionary containing celery settings from
286 # http://docs.celeryproject.org/en/latest/configuration.html
287 CELERY_CONF = dict(
288 CELERY_SEND_TASK_ERROR_EMAILS = True,
289 ADMINS=ADMINS,
290 SERVER_EMAIL = "no-reply@example.com",
294 ### Google API
296 GOOGLE_CLIENT_ID=''
297 GOOGLE_CLIENT_SECRET=''
301 try:
302 from settings_prod import *
303 except ImportError, e:
304 import sys
305 print >> sys.stderr, 'create settings_prod.py with your customized settings'