forked from ckan/ckan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wsgi.py
20 lines (15 loc) · 587 Bytes
/
wsgi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- coding: utf-8 -*-
import os
from ckan.config.middleware import make_app
from ckan.cli import CKANConfigLoader
from logging.config import fileConfig as loggingFileConfig
if os.environ.get(u'CKAN_INI'):
config_path = os.environ[u'CKAN_INI']
else:
config_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), u'ckan.ini')
if not os.path.exists(config_path):
raise RuntimeError(u'CKAN config option not found: {}'.format(config_path))
loggingFileConfig(config_path)
config = CKANConfigLoader(config_path).get_config()
application = make_app(config)