realms-wiki/realms/config/__init__.py

59 lines
1.1 KiB
Python
Raw Normal View History

2014-08-20 18:28:25 +03:00
import os
import json
from urlparse import urlparse
2013-12-03 22:09:57 +02:00
2014-08-20 18:28:25 +03:00
ENV = 'DEV'
2013-12-03 22:09:57 +02:00
2014-08-20 18:28:25 +03:00
DEBUG = True
ASSETS_DEBUG = True
2013-12-03 22:09:57 +02:00
2014-08-30 18:06:12 +03:00
SQLALCHEMY_ECHO = True
2014-08-20 18:28:25 +03:00
PORT = 80
BASE_URL = 'http://realms.dev'
2013-12-03 22:09:57 +02:00
2014-08-30 18:06:12 +03:00
DB_URI = 'sqlite:////home/deploy/wiki.db'
CACHE_TYPE = 'simple'
# Redis Example
"""
CACHE_TYPE = 'redis'
CACHE_REDIS_HOST = '127.0.0.1'
CACHE_REDIS_PORT = 6379
CACHE_REDIS_DB = '0'
"""
2013-12-03 22:09:57 +02:00
2014-08-30 18:06:12 +03:00
RECAPTCHA_ENABLE = True
RECAPTCHA_USE_SSL = False
RECAPTCHA_PUBLIC_KEY = "6LfYbPkSAAAAAB4a2lG2Y_Yjik7MG9l4TDzyKUao"
RECAPTCHA_PRIVATE_KEY = "6LfYbPkSAAAAAG-KlkwjZ8JLWgwc9T0ytkN7lWRE"
RECAPTCHA_OPTIONS = {}
SECRET_KEY = 'K3dRq1q9eN72GJDkgvyshFVwlqHHCyPI'
2013-12-03 22:09:57 +02:00
2014-08-20 18:28:25 +03:00
WIKI_PATH = '/home/deploy/wiki'
WIKI_HOME = 'home'
ALLOW_ANON = True
2014-08-30 18:06:12 +03:00
LOGIN_DISABLED = ALLOW_ANON
2013-12-03 22:09:57 +02:00
ROOT_ENDPOINT = 'wiki.page'
2014-08-20 18:28:25 +03:00
with open(os.path.join(os.path.dirname(__file__) + "/../../", 'config.json')) as f:
__settings = json.load(f)
globals().update(__settings)
if BASE_URL.endswith('/'):
BASE_URL = BASE_URL[-1]
2014-08-30 18:06:12 +03:00
SQLALCHEMY_DATABASE_URI = DB_URI
2014-08-20 18:28:25 +03:00
_url = urlparse(BASE_URL)
RELATIVE_PATH = _url.path
if ENV != "DEV":
DEBUG = False
ASSETS_DEBUG = False
MODULES = ['wiki', 'auth']