diff --git a/fuqit/web.py b/fuqit/web.py index 5a7b7a7..511ee8c 100644 --- a/fuqit/web.py +++ b/fuqit/web.py @@ -58,7 +58,7 @@ def process(method, path, params, context): def render_template(path, variables, ext=None): ext = ext or os.path.splitext(path)[1] - headers = tools.make_ctype(ext, config.default_mtype) + headers = tools.make_ctype(ext, config.__dict__.get('default_mtype', 'text/html')) if 'headers' in variables: sessions.load_session(variables) @@ -176,8 +176,8 @@ def configure(app_module="app", config_module="config"): config.app_path = os.path.realpath(app_module) config.errors_dir = config.app_path + '/errors/' config.env = Environment(loader=PackageLoader(config.app_module, '.')) - config.allowed_referer = re.compile(config.allowed_referer) + config.allowed_referer = re.compile(config.__dict__.get('allowed_referer', '.*')) config.static_dir = os.path.realpath(config.app_path + - (config.static_dir or '/static/')) + (config.__dict__.get('static_dir ', '/static/') )) diff --git a/setup.py b/setup.py index 6abfb9b..9707c41 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ 'author_email': 'zedshaw@zedshaw.com', 'version': '1.0', 'scripts': ['bin/fuqit'], - 'install_requires': ['python-modargs', 'python-lust'], + 'install_requires': ['python-modargs', 'python-lust', 'jinja2'], 'packages': ['fuqit', 'fuqit.data'], 'name': 'fuqit' }