Always use config.toml in same directory as app.py

このコミットが含まれているのは:
n9k 2022-02-20 04:42:24 +00:00
コミット 546b5b2f6f
2個のファイルの変更5行の追加3行の削除

ファイルの表示

@ -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)

4
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)