diff --git a/anonstream/__init__.py b/anonstream/__init__.py index b42b3bd..69373ff 100644 --- a/anonstream/__init__.py +++ b/anonstream/__init__.py @@ -10,8 +10,8 @@ from anonstream.utils.captcha import create_captcha_factory, create_captcha_sign from anonstream.utils.colour import color_to_colour from anonstream.utils.user import generate_token -def create_app(): - with open('config.toml') as fp: +def create_app(config_file): + with open(config_file) as fp: config = toml.load(fp) auth_password = secrets.token_urlsafe(6) diff --git a/app.py b/app.py index 33a34d3..6390963 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,8 @@ +import os import anonstream -app = anonstream.create_app() +config_file = os.path.join(os.path.dirname(__file__), 'config.toml') +app = anonstream.create_app(config_file) if __name__ == '__main__': app.run(port=5051, debug=True)