microblog2/config.py

50 lines
1.4 KiB
Python
Raw Normal View History

2013-02-01 05:48:20 +00:00
# -*- coding: utf8 -*-
2012-12-16 08:29:49 +00:00
import os
basedir = os.path.abspath(os.path.dirname(__file__))
2012-12-16 08:28:52 +00:00
CSRF_ENABLED = True
SECRET_KEY = 'you-will-never-guess'
OPENID_PROVIDERS = [
{ 'name': 'Google', 'url': 'https://www.google.com/accounts/o8/id' },
{ 'name': 'Yahoo', 'url': 'https://me.yahoo.com' },
{ 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' },
{ 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' },
2012-12-16 08:29:49 +00:00
{ 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }]
2013-04-22 05:08:46 +00:00
if os.environ.get('DATABASE_URL') is None:
2013-04-15 06:13:17 +00:00
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') + '?check_same_thread=False'
else:
2013-04-22 05:08:46 +00:00
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
2012-12-16 08:32:38 +00:00
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
2013-03-10 04:17:06 +00:00
SQLALCHEMY_RECORD_QUERIES = True
2012-12-16 08:35:16 +00:00
WHOOSH_BASE = os.path.join(basedir, 'search.db')
2012-12-16 08:32:38 +00:00
2013-03-10 04:17:06 +00:00
# slow database query threshold (in seconds)
DATABASE_QUERY_TIMEOUT = 0.5
2012-12-16 08:36:04 +00:00
# email server
2013-04-15 06:13:17 +00:00
MAIL_SERVER = '' # your mailserver
2012-12-16 08:32:38 +00:00
MAIL_PORT = 25
2012-12-16 08:36:04 +00:00
MAIL_USE_TLS = False
MAIL_USE_SSL = False
MAIL_USERNAME = 'you'
MAIL_PASSWORD = 'your-password'
2012-12-16 08:32:38 +00:00
2013-02-01 05:48:20 +00:00
# available languages
LANGUAGES = {
'en': 'English',
'es': 'Español'
}
2013-02-20 06:59:54 +00:00
# microsoft translation service
MS_TRANSLATOR_CLIENT_ID = '' # enter your MS translator app id here
MS_TRANSLATOR_CLIENT_SECRET = '' # enter your MS translator app secret here
2012-12-16 08:32:38 +00:00
# administrator list
ADMINS = ['you@example.com']
2012-12-16 08:34:46 +00:00
# pagination
2013-03-10 04:17:06 +00:00
POSTS_PER_PAGE = 50
2012-12-16 08:35:16 +00:00
MAX_SEARCH_RESULTS = 50