remove deprecation warning for request.raw_post_data
[mygpo.git] / mygpo / settings.py
blob58cf57e15471ca1a45395a44b145109f87e16ecf
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', 'http://127.0.0.1:5984/mygpo'),
44 ('mygpo.core', 'http://127.0.0.1:5984/mygpo'),
45 ('mygpo.api', 'http://127.0.0.1:5984/mygpo'),
46 ('mygpo.users', 'http://127.0.0.1:5984/mygpo'),
47 ('mygpo.share', 'http://127.0.0.1:5984/mygpo'),
48 ('mygpo.maintenance', 'http://127.0.0.1:5984/mygpo'),
49 ('django_couchdb_utils_auth', 'http://127.0.0.1:5984/mygpo'),
50 ('django_couchdb_utils_sessions', 'http://127.0.0.1:5984/mygpo_sessions'),
51 ('django_couchdb_utils_registration', 'http://127.0.0.1:5984/mygpo'),
55 # Local time zone for this installation. Choices can be found here:
56 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
57 # although not all choices may be available on all operating systems.
58 # If running in a Windows environment this must be set to the same as your
59 # system time zone.
60 TIME_ZONE = 'UTC'
62 # Language code for this installation. All choices can be found here:
63 # http://www.i18nguy.com/unicode/language-identifiers.html
64 LANGUAGE_CODE = 'en-us'
66 SITE_ID = 1
68 # If you set this to False, Django will make some optimizations so as not
69 # to load the internationalization machinery.
70 USE_I18N = True
72 # Absolute path to the directory that holds media.
73 # Example: "/home/media/media.lawrence.com/"
74 MEDIA_ROOT = os.path.abspath('%s/../htdocs/media/' % os.path.dirname(__file__))
76 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
77 # trailing slash if there is a path component (optional in other cases).
78 # Examples: "http://media.lawrence.com", "http://example.com/media/"
79 MEDIA_URL = ''
81 # List of callables that know how to import templates from various sources.
82 TEMPLATE_LOADERS = (
83 'django.template.loaders.app_directories.Loader',
86 MIDDLEWARE_CLASSES = (
87 'django.middleware.cache.UpdateCacheMiddleware',
88 'django.middleware.common.CommonMiddleware',
89 'django.middleware.csrf.CsrfViewMiddleware',
90 'django.middleware.cache.FetchFromCacheMiddleware',
91 'django.contrib.sessions.middleware.SessionMiddleware',
92 'django.contrib.auth.middleware.AuthenticationMiddleware',
93 'django.middleware.locale.LocaleMiddleware',
94 'django.contrib.messages.middleware.MessageMiddleware',
97 ROOT_URLCONF = 'mygpo.urls'
99 TEMPLATE_DIRS = ()
101 INSTALLED_APPS = (
102 'django.contrib.contenttypes', # unused, but tests fail otherwise (?)
103 'django.contrib.messages',
104 'django.contrib.humanize',
105 'couchdbkit.ext.django',
106 'django_couchdb_utils.auth',
107 'django_couchdb_utils.sessions',
108 'django_couchdb_utils.registration',
109 'mygpo.core',
110 'mygpo.users',
111 'mygpo.api',
112 'mygpo.web',
113 'mygpo.publisher',
114 'mygpo.data',
115 'mygpo.userfeeds',
116 'mygpo.directory',
117 'mygpo.maintenance',
118 'mygpo.share',
119 'mygpo.admin',
120 'mygpo.db.couchdb',
123 TEST_EXCLUDE = (
124 'django',
125 'couchdbkit',
128 TEST_RUNNER='mygpo.test.MygpoTestSuiteRunner'
130 ACCOUNT_ACTIVATION_DAYS = 7
132 AUTHENTICATION_BACKENDS = (
133 'django_couchdb_utils.auth.backends.CouchDBAuthBackend',
134 'mygpo.web.auth.EmailAuthenticationBackend',
137 SESSION_ENGINE = "django_couchdb_utils.sessions.cached_couchdb"
139 TEMPLATE_CONTEXT_PROCESSORS = (
140 "django.contrib.auth.context_processors.auth",
141 "django.core.context_processors.debug",
142 "django.core.context_processors.i18n",
143 "django.core.context_processors.media",
144 "django.contrib.messages.context_processors.messages",
145 "mygpo.web.google.analytics",
146 "mygpo.web.google.adsense",
149 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
151 USER_CLASS = 'mygpo.users.models.User'
153 AUTH_PROFILE_MODULE = "api.UserProfile"
156 LOGIN_URL = '/login/'
158 CSRF_FAILURE_VIEW='mygpo.web.views.security.csrf_failure'
161 # The following entries should be set in settings_prod.py
162 DEFAULT_FROM_EMAIL = ''
163 SECRET_KEY = ''
164 GOOGLE_ANALYTICS_PROPERTY_ID=''
165 DIRECTORY_EXCLUDED_TAGS = ()
166 FLICKR_API_KEY = ''
168 MAINTENANCE = os.path.exists(os.path.join(BASE_DIR, 'MAINTENANCE'))
170 EMAIL_BACKEND = 'django_couchdb_utils.email.backends.CouchDBEmailBackend'
172 # minimum number of subscribers a podcast must have to be assigned a slug
173 PODCAST_SLUG_SUBSCRIBER_LIMIT = 10
175 # minimum number of subscribers that a podcast needs to "push" one of its
176 # categories to the top
177 MIN_SUBSCRIBERS_CATEGORY=10
180 ADSENSE_CLIENT = ''
181 ADSENSE_SLOT_BOTTOM = ''
183 # enabled access to staff-only areas with ?staff=<STAFF_TOKEN>
184 STAFF_TOKEN = None
186 # Flattr settings -- available after you register your app
187 FLATTR_KEY = ''
188 FLATTR_SECRET = ''
190 # Flattr thing of the webservice. Will be flattr'd when a user sets the "Auto-Flattr gpodder.net" option
191 FLATTR_MYGPO_THING='https://flattr.com/submit/auto?user_id=stefankoegl&url=http://gpodder.net'
193 # The User-Agent string used for outgoing HTTP requests
194 USER_AGENT = 'gpodder.net (+https://github.com/gpodder/mygpo)'
198 ### Celery
200 BROKER_URL='redis://localhost'
201 BACKEND_URL='redis://localhost'
204 # a dictionary containing celery settings from
205 # http://docs.celeryproject.org/en/latest/configuration.html
206 CELERY_CONF = dict(
207 CELERY_SEND_TASK_ERROR_EMAILS = True,
208 ADMINS=ADMINS,
209 SERVER_EMAIL = "no-reply@example.com",
214 try:
215 from settings_prod import *
216 except ImportError, e:
217 import sys
218 print >> sys.stderr, 'create settings_prod.py with your customized settings'