From 4a72fb7320bc8b1b7838112b4ea64f83b33e73c0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 26 2015 10:19:03 +0000 Subject: Rely on werkzeug to load the configuration file --- diff --git a/mdapi/__init__.py b/mdapi/__init__.py index 4c68aa2..943f9b8 100644 --- a/mdapi/__init__.py +++ b/mdapi/__init__.py @@ -30,6 +30,7 @@ except ImportError: import json import asyncio +import werkzeug from aiohttp import web import mdapi.lib as mdapilib @@ -37,7 +38,7 @@ import mdapi.file_lock as file_lock CONFIG = dict() -obj = __import__('mdapi.default_config') +obj = werkzeug.import_string('mdapi.default_config') for key in dir(obj): if key.isupper(): CONFIG[key] = getattr(obj, key) diff --git a/requirements.txt b/requirements.txt index 8fc791d..eeb4a23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ aiohttp requests simplejson sqlalchemy +werkzeug