Skip to content
Snippets Groups Projects
Commit 6c3290a9 authored by Vermaat's avatar Vermaat
Browse files

Always give absolute template_folder and static_folder to Flask

For some reason, `pkg_resources.resource_filename` returns a relative path
if we call Mutalyzer using `python -m mutalyzer.entrypoints.*`. The path
is of course valid, but we pass it to Flask, which assumes relative paths
to be relative to the Python package root. To circumvent this incorrect
assumption, we first make the path absolute before passing it to Flask.
parent 352c590b
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ Mutalyzer website interface using the Flask framework.
"""
import os
import pkg_resources
from flask import Flask
......@@ -57,7 +58,8 @@ def create_app():
'mutalyzer', 'website/templates/static')
app = Flask('mutalyzer',
template_folder=template_folder, static_folder=static_folder)
template_folder=os.path.abspath(template_folder),
static_folder=os.path.abspath(static_folder))
app.config.update(DEBUG=settings.DEBUG,
TESTING=settings.TESTING,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment