handle large episode action uploads in background
[mygpo.git] / mygpo / settings.py
blob520bc774503b399648c9b5ba85bce2c265b93a2e
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 'django_couchdb_utils_auth':
62 {'URL': 'http://127.0.0.1:5984/mygpo'},
64 'django_couchdb_utils_sessions':
65 {'URL': 'http://127.0.0.1:5984/mygpo_sessions'},
67 'django_couchdb_utils_registration':
68 {'URL': 'http://127.0.0.1:5984/mygpo'},
72 # Local time zone for this installation. Choices can be found here:
73 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
74 # although not all choices may be available on all operating systems.
75 # If running in a Windows environment this must be set to the same as your
76 # system time zone.
77 TIME_ZONE = 'UTC'
79 # Language code for this installation. All choices can be found here:
80 # http://www.i18nguy.com/unicode/language-identifiers.html
81 LANGUAGE_CODE = 'en-us'
83 SITE_ID = 1
85 # If you set this to False, Django will make some optimizations so as not
86 # to load the internationalization machinery.
87 USE_I18N = True
89 # Absolute path to the directory that holds media.
90 # Example: "/home/media/media.lawrence.com/"
91 MEDIA_ROOT = os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__))
93 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
94 # trailing slash if there is a path component (optional in other cases).
95 # Examples: "http://media.lawrence.com", "http://example.com/media/"
96 MEDIA_URL = ''
98 # List of callables that know how to import templates from various sources.
99 TEMPLATE_LOADERS = (
100 'django.template.loaders.app_directories.Loader',
103 MIDDLEWARE_CLASSES = (
104 'django.middleware.cache.UpdateCacheMiddleware',
105 'django.middleware.common.CommonMiddleware',
106 'django.middleware.csrf.CsrfViewMiddleware',
107 'django.middleware.cache.FetchFromCacheMiddleware',
108 'django.contrib.sessions.middleware.SessionMiddleware',
109 'django.contrib.auth.middleware.AuthenticationMiddleware',
110 'django.middleware.locale.LocaleMiddleware',
111 'django.contrib.messages.middleware.MessageMiddleware',
114 ROOT_URLCONF = 'mygpo.urls'
116 TEMPLATE_DIRS = ()
118 INSTALLED_APPS = (
119 'django.contrib.contenttypes', # unused, but tests fail otherwise (?)
120 'django.contrib.messages',
121 'django.contrib.humanize',
122 'couchdbkit.ext.django',
123 'django_couchdb_utils.auth',
124 'django_couchdb_utils.sessions',
125 'django_couchdb_utils.registration',
126 'mygpo.core',
127 'mygpo.users',
128 'mygpo.api',
129 'mygpo.web',
130 'mygpo.publisher',
131 'mygpo.data',
132 'mygpo.userfeeds',
133 'mygpo.directory',
134 'mygpo.maintenance',
135 'mygpo.share',
136 'mygpo.admin',
137 'mygpo.db.couchdb',
140 TEST_EXCLUDE = (
141 'django',
142 'couchdbkit',
145 TEST_RUNNER='mygpo.test.MygpoTestSuiteRunner'
147 ACCOUNT_ACTIVATION_DAYS = 7
149 AUTHENTICATION_BACKENDS = (
150 'django_couchdb_utils.auth.backends.CouchDBAuthBackend',
151 'mygpo.web.auth.EmailAuthenticationBackend',
154 SESSION_ENGINE = "django_couchdb_utils.sessions.cached_couchdb"
156 TEMPLATE_CONTEXT_PROCESSORS = (
157 "django.contrib.auth.context_processors.auth",
158 "django.core.context_processors.debug",
159 "django.core.context_processors.i18n",
160 "django.core.context_processors.media",
161 "django.contrib.messages.context_processors.messages",
162 "mygpo.web.google.analytics",
163 "mygpo.web.google.adsense",
166 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
168 USER_CLASS = 'mygpo.users.models.User'
170 AUTH_PROFILE_MODULE = "api.UserProfile"
173 LOGIN_URL = '/login/'
175 CSRF_FAILURE_VIEW='mygpo.web.views.security.csrf_failure'
178 # The following entries should be set in settings_prod.py
179 DEFAULT_FROM_EMAIL = ''
180 SECRET_KEY = ''
181 GOOGLE_ANALYTICS_PROPERTY_ID=''
182 DIRECTORY_EXCLUDED_TAGS = ()
183 FLICKR_API_KEY = ''
185 MAINTENANCE = os.path.exists(os.path.join(BASE_DIR, 'MAINTENANCE'))
187 EMAIL_BACKEND = 'django_couchdb_utils.email.backends.CouchDBEmailBackend'
189 # minimum number of subscribers a podcast must have to be assigned a slug
190 PODCAST_SLUG_SUBSCRIBER_LIMIT = 10
192 # minimum number of subscribers that a podcast needs to "push" one of its
193 # categories to the top
194 MIN_SUBSCRIBERS_CATEGORY=10
196 # maximum number of episode actions that the API processes immediatelly before
197 # returning the response. Larger requests will be handled in background.
198 # Handler can be set to None to disable
199 API_ACTIONS_MAX_NONBG=100
200 API_ACTIONS_BG_HANDLER='mygpo.api.tasks.episode_actions_celery_handler'
203 ADSENSE_CLIENT = ''
204 ADSENSE_SLOT_BOTTOM = ''
206 # enabled access to staff-only areas with ?staff=<STAFF_TOKEN>
207 STAFF_TOKEN = None
209 # Flattr settings -- available after you register your app
210 FLATTR_KEY = ''
211 FLATTR_SECRET = ''
213 # Flattr thing of the webservice. Will be flattr'd when a user sets the "Auto-Flattr gpodder.net" option
214 FLATTR_MYGPO_THING='https://flattr.com/submit/auto?user_id=stefankoegl&url=http://gpodder.net'
216 # The User-Agent string used for outgoing HTTP requests
217 USER_AGENT = 'gpodder.net (+https://github.com/gpodder/mygpo)'
221 ### Celery
223 BROKER_URL='redis://localhost'
224 BACKEND_URL='redis://localhost'
227 # a dictionary containing celery settings from
228 # http://docs.celeryproject.org/en/latest/configuration.html
229 CELERY_CONF = dict(
230 CELERY_SEND_TASK_ERROR_EMAILS = True,
231 ADMINS=ADMINS,
232 SERVER_EMAIL = "no-reply@example.com",
236 ### Google API
238 GOOGLE_CLIENT_ID=''
239 GOOGLE_CLIENT_SECRET=''
243 try:
244 from settings_prod import *
245 except ImportError, e:
246 import sys
247 print >> sys.stderr, 'create settings_prod.py with your customized settings'