{"id":16721729,"url":"https://github.com/zoltan-nz/flask-playground","last_synced_at":"2026-04-24T16:33:22.173Z","repository":{"id":43047418,"uuid":"185733179","full_name":"zoltan-nz/flask-playground","owner":"zoltan-nz","description":"Python Flask, playground, tutorial, best practices, modern implementation","archived":false,"fork":false,"pushed_at":"2022-12-26T21:00:11.000Z","size":272,"stargazers_count":1,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T13:03:41.506Z","etag":null,"topics":["flask","playground","python","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoltan-nz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-09T05:38:38.000Z","updated_at":"2020-02-20T13:49:52.000Z","dependencies_parsed_at":"2023-01-31T01:45:54.345Z","dependency_job_id":null,"html_url":"https://github.com/zoltan-nz/flask-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltan-nz%2Fflask-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltan-nz%2Fflask-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltan-nz%2Fflask-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoltan-nz%2Fflask-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoltan-nz","download_url":"https://codeload.github.com/zoltan-nz/flask-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294459,"owners_count":20915337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","playground","python","tutorial"],"created_at":"2024-10-12T22:32:01.783Z","updated_at":"2026-04-24T16:33:22.126Z","avatar_url":"https://github.com/zoltan-nz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Playground\n\n- [Flask Tutorial](http://flask.pocoo.org/docs/1.0/tutorial/)\n\n## Prerequisite\n\n- Python 3.7 with `pyenv`\n\n```bash\n# Mac Mojave hack\n$ CFLAGS=\"-I$(xcrun --show-sdk-path)/usr/include\" pyenv install 3.7.4\n$ pyenv global 3.7.4\n\n# Check installation\n$ pyenv versions\n$ python --version\n```\n\n- Pipenv\n\n```bash\n$ pip install pipenv\n```\n\n## Run this project\n\n```bash\n$ git clone git@github.com:zoltan-nz/flask-playground.git\n$ cd flask-playground\n$ PIPENV_VENV_IN_PROJECT=1 pipenv run setup\n$ pipenv run init-db-dev\n$ pipenv run server-watch\n```\n\n## Development\n\nTest:\n\n```bash\n$ pytest\n```\n\nTest with watch:\n\n```\n$ pipenv run test-watch\n```\n\nLint:\n\n```bash\n$ pylint --load-plugins pylint_flask flaskr test\n```\n\nFormat:\n\n```bash\n$ black **/*.py\n```\n\n## DX (Development Experience)\n\n```\n$ pipenv run test-watch\n$ DEBUG=1 pipenv run app-watch\n```\n\n## Initialize `pipenv` and `flask`\n\n```\n$ pipenv --python 3.7\n$ pipenv install flask\n```\n\nFurthermore we can add the following useful packages for development.\n\n```\n$ pipenv install -d pytest black pylint pylint-flask coverage pytest-cov pytest-testmon pytest-watch --pre\n```\n\nThe `black` package has only pre-release version. For this reason the `--pre` option should be used.\n\n## Configuration files\n\n- `pylintrc`\n- `setup.cfg`\n\n## Add dotenv support\n\n```\n$ pipenv install python-dotenv\n```\n\n## Links\n\n- [Pyenv](https://github.com/pyenv/pyenv)\n- [Pipenv](https://docs.pipenv.org/en/latest/)\n- [Flask](http://flask.pocoo.org/)\n- [Pytest](https://docs.pytest.org/en/latest/)\n- [Black](https://black.readthedocs.io/en/stable/)\n- [Pylint](https://www.pylint.org/)\n- [Flask extensions](https://nickjanetakis.com/blog/15-useful-flask-extensions-and-libraries-that-i-use-in-every-project)\n- [Flask with MongoDB Tutorial](https://medium.com/@riken.mehta/full-stack-tutorial-flask-react-docker-420da3543c91)\n\n## Heroku deployment notes\n\nBuilding production package:\n\n```\npython setup.py bdist_wheel\n```\n\nIt is required that `FLASK_APP=flaskr` environment variable being setup. Afterward the following CLI script can be run.\n\n```\n$ heroku run python3 -m flask init-db\n```\n\n## Run a Docker locally\n\n0. Install Docker for Mac\n1. Build the docker image: `flaskr:latest`.\n2. Create a Volume for database. Volume name is `db`.\n3. Initialize the database.\n4. Run the image and attach the volume and bind a port.\n\n\n```bash\n$ pipenv run build-docker\n$ docker volume create db\n$ docker run -it -p 8080:8080 -v db:/home/app/db flaskr:latest flask init-db \n$ docker run -it -p 8080:8080 -v db:/home/app/db flaskr:latest\n$ open http://localhost:8080\n```\n\n## Run Kubernetes locally (Instructions for Mac)\n\n0. Install Docker for Mac.\n1. Turn on Kubernetes support.\n2. Check `kubectl` command availability.\n3. Install `octant` for visibility.\n4. Run deployment configuration.\n\n```bash\n$ brew install octant\n$ octant\n$ pipenv run deploy-kubernetes-local\n$ open http://localhost:9090\n```\n\n## Use GitLab Runner, Kubernetes and Google Cloud\n\n[Deploy using Kubernetes](./kubernetes/README.md)\n\n## Upgrading Python\n\nWhen a new version of Python is installed (with `pyenv`) rebuild the virtual environment with running the following commands.\n\n```bash\n$ pipenv --rm\n$ pipenv run setup\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoltan-nz%2Fflask-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoltan-nz%2Fflask-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoltan-nz%2Fflask-playground/lists"}