Always use config.toml in same directory as app.py
このコミットが含まれているのは:
コミット
546b5b2f6f
|
@ -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.colour import color_to_colour
|
||||||
from anonstream.utils.user import generate_token
|
from anonstream.utils.user import generate_token
|
||||||
|
|
||||||
def create_app():
|
def create_app(config_file):
|
||||||
with open('config.toml') as fp:
|
with open(config_file) as fp:
|
||||||
config = toml.load(fp)
|
config = toml.load(fp)
|
||||||
|
|
||||||
auth_password = secrets.token_urlsafe(6)
|
auth_password = secrets.token_urlsafe(6)
|
||||||
|
|
4
app.py
4
app.py
|
@ -1,6 +1,8 @@
|
||||||
|
import os
|
||||||
import anonstream
|
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__':
|
if __name__ == '__main__':
|
||||||
app.run(port=5051, debug=True)
|
app.run(port=5051, debug=True)
|
||||||
|
|
読み込み中…
新しいイシューから参照