Browse Source

Add APP_PATH env variable

Getty Ritter 2 years ago
parent
commit
c52fab0b7e
2 changed files with 5 additions and 1 deletions
  1. 1 0
      lc/config.py
  2. 4 1
      tasks.py

+ 1 - 0
lc/config.py

@@ -8,6 +8,7 @@ import playhouse.sqlite_ext
 db = playhouse.sqlite_ext.SqliteExtDatabase(None)
 per_page = 50
 serializer = itsdangerous.URLSafeTimedSerializer(os.getenv("SECRET_KEY", "TEMP KEY"))
+app_path = os.environ["APP_PATH"]
 app = flask.Flask(__name__)
 app.secret_key = os.getenv("SECRET_KEY", "ARGLBARGL")
 

+ 4 - 1
tasks.py

@@ -13,7 +13,10 @@ def run(c, port=8080, host="127.0.0.1"):
     """Run a debug server locally"""
     c.run(
         f"poetry run python -m flask run -p {port} -h {host}",
-        env={"FLASK_APP": "lament-configuration.py"},
+        env={
+            "FLASK_APP": "lament-configuration.py",
+            "APP_PATH": f"http://{host}:{port}",
+        },
     )