diff --git a/.gitignore b/.gitignore index 32414aa..14bf85f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ venv/ .DS_Store -__pycache__ \ No newline at end of file +__pycache__ +.env \ No newline at end of file diff --git a/main.py b/main.py index 0ebb5bf..33ffdda 100644 --- a/main.py +++ b/main.py @@ -1,9 +1,16 @@ from flask import Flask, render_template, send_from_directory from markdown import markdown from prefix import PrefixMiddleware +from dotenv import load_dotenv +import os + +load_dotenv() +prefix = os.environ.get('URL_PREFIX', '') +port = os.environ.get('PORT', '3000') +debug = os.environ.get('DEBUG', 'False') app = Flask(__name__) -app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix='/soupboat/wlist') +app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix=prefix) @app.route('/') @@ -17,4 +24,4 @@ def list(): def send_img(file): return send_from_directory(app.root_path + '/img/', file, conditional=True) -app.run(port="3148", debug=True) \ No newline at end of file +app.run(port=port, debug=debug) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 2e17d0d..a6ad081 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,10 @@ click==8.1.3 -colorama==0.4.6 Flask==2.2.2 +importlib-metadata==5.0.0 itsdangerous==2.1.2 Jinja2==3.1.2 Markdown==3.4.1 MarkupSafe==2.1.1 +python-dotenv==0.21.0 Werkzeug==2.2.2 +zipp==3.10.0