updated to run under waitress

This commit is contained in:
2026-07-16 07:13:26 +02:00
parent 27dbd344d6
commit f1ed598ebe
4 changed files with 16 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
.venv/
__pycache__/
.pytest_cache/
*.py[cod]
config.yaml
instance/
+8 -2
View File
@@ -10,9 +10,13 @@ Amounts and worked/vacation/sick statuses selected for dates are stored persiste
python3 -m venv .venv python3 -m venv .venv
source .venv/bin/activate source .venv/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
python app.py waitress-serve --host=0.0.0.0 --port=9009 app:app
``` ```
To use a different port, substitute it in the command (for example,
`--port=8080`). The application exposes its WSGI callable as `app:app`, so it
can also be used by platforms that ask for an application entry point.
Set the username, password, and Flask signing key in `config.yaml` before starting. This file is excluded from Git. Use `config.example.yaml` as the documented template when setting up another machine. Set the username, password, and Flask signing key in `config.yaml` before starting. This file is excluded from Git. Use `config.example.yaml` as the documented template when setting up another machine.
The two paid quick-choice buttons are configured in the same file: The two paid quick-choice buttons are configured in the same file:
@@ -36,6 +40,8 @@ python scripts/import_excel.py /path/to/fatima.xlsx
Add `--apply` to import. The command backs up the existing SQLite file before updating it. Add `--apply` to import. The command backs up the existing SQLite file before updating it.
On the iPhone, visit `http://<your-computer-on-the-local-network>:5000`. The development server listens on all network interfaces. For anything exposed beyond a trusted home network, run behind HTTPS with a production WSGI server. On the iPhone, visit `http://<your-computer-on-the-local-network>:9009`.
Waitress listens on all network interfaces with the command above. For anything
exposed beyond a trusted home network, put it behind an HTTPS reverse proxy.
For deployments, `APP_CONFIG` can point to a YAML file elsewhere. `SECRET_KEY`, `APP_USERNAME`, and `APP_PASSWORD` environment variables optionally override the corresponding YAML values. For deployments, `APP_CONFIG` can point to a YAML file elsewhere. `SECRET_KEY`, `APP_USERNAME`, and `APP_PASSWORD` environment variables optionally override the corresponding YAML values.
+1 -1
View File
@@ -273,4 +273,4 @@ def create_app(test_config=None):
app = create_app() app = create_app()
if __name__ == "__main__": if __name__ == "__main__":
app.run(host="0.0.0.0", port=int(os.environ.get("PORT", "9009")), debug=True) app.run(host="0.0.0.0", port=int(os.environ.get("PORT", "9009")))
+1
View File
@@ -1,3 +1,4 @@
Flask==3.1.1 Flask==3.1.1
PyYAML==6.0.2 PyYAML==6.0.2
openpyxl==3.1.5 openpyxl==3.1.5
waitress==3.0.2