Blog: 2023-08-21
Jump to navigation
Jump to search
fish $ docker run -it -p 5000:5000 \
-e BASIC_AUTH_USERNAME=local \
-e BASIC_AUTH_PASSWORD=local \
-e SECRET_KEY=localsecret \
--network slirp4netns:allow_host_loopback=true \
-e DATABASE_URL=postgresql://pgclient:[email protected]:5432/weave \
(last-image-built) poetry run gunicorn app -b 0.0.0.0:5000
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Counting objects: 100% (57/57), done.
Delta compression using up to 8 threads
Compressing objects: 100% (31/31), done.
Writing objects: 100% (33/33), 129.29 KiB | 8.08 MiB/s, done.
Total 33 (delta 28), reused 0 (delta 0), pack-reused 0
To github.com:razzius/weave
f726dd1..c01fe19 main -> main
weave $ ls
CITATION.md LICENSE Procfile Vagrantfile app.json build/ mypy.ini package.json public/ pytest.ini scripts/ src/ yarn-error.log
Dockerfile Makefile README.md __pycache__/ app.py flow-typed/ node_modules/ poetry.lock pyproject.toml saml.py server/ tests/ yarn.lock
weave $ vim app.json
weave $ curl 'http://localhost:5000/api/send-student-verification-email' -X POST -H 'Accept: application/json' -H 'content-type: application/json' -H 'Origin: http://localhost:5000' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data-raw '{"email":"[email protected]","is_personal_device":true}
Want to answer https://stackoverflow.com/questions/17791571/how-can-i-test-a-flask-application-which-uses-sqlalchemy
with https://github.com/pamelafox/flask-surveys-container-app/blob/main/src/backend/tests/conftest.py
which worked for me
Interesting about clearing terminals and using xxd to view output of this type of command https://apple.stackexchange.com/a/318217/188310