├── .gitignore ├── README.md ├── .gitpod.yml └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .venv/ 2 | *.pyc 3 | __pycache__/ 4 | instance/ 5 | .cache/ 6 | .pytest_cache/ 7 | .coverage 8 | htmlcov/ 9 | dist/ 10 | build/ 11 | *.egg-info/ 12 | .idea/ 13 | *.swp 14 | *~ 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A Python Flask template on Gitpod 2 | 3 | This is a [Python Flask](https://flask.palletsprojects.com/) template generator configured for ephemeral cloud development environments on [Gitpod](https://www.gitpod.io/). 4 | 5 | ## Next Steps 6 | 7 | Click the button below to start a new development environment: 8 | 9 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-python-flask) 10 | 11 | ## Get Started With Your Own Project 12 | 13 | ### A new project 14 | 15 | Click the above "Open in Gitpod" button to start a new workspace. Once you're ready to push your first code changes, Gitpod will guide you to fork this project so you own it. 16 | 17 | ### An existing project 18 | 19 | Copy and commit the [`.gitpod.yml`](./.gitpod.yml) to your existing project to have the same configuration of this template. To learn more, please see the [Getting Started](https://www.gitpod.io/docs/getting-started) documentation. 20 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # Image source code: https://github.com/axonasif/workspace-images/tree/tmp 2 | # Also see: https://github.com/gitpod-io/workspace-images/issues/1071 3 | image: axonasif/workspace-python@sha256:f5ba627a31505ea6cf100abe8e552d7ff9e0abd6ba46745b6d6dab349c001430 4 | 5 | tasks: 6 | - name: Init project and run server 7 | init: | 8 | PROJECT_NAME="flaskr" 9 | 10 | if test ! -e "${PROJECT_NAME}"; then { 11 | tmp_dir=/tmp/.fgc 12 | git clone --filter=tree:0 https://github.com/pallets/flask "${tmp_dir}" 13 | mv "${tmp_dir}/examples/tutorial"/{.*,*} . 2>/dev/null 14 | rm -rf "${tmp_dir}" 15 | } fi 16 | 17 | pip install -e . 18 | if test -e "${PROJECT_NAME}"; then { 19 | flask --app "${PROJECT_NAME}" init-db 20 | } fi 21 | 22 | command: | 23 | PROJECT_NAME="flaskr" 24 | 25 | flask --app "${PROJECT_NAME}" run --debug 26 | 27 | ports: 28 | - port: 5000 29 | onOpen: open-preview 30 | description: Flask App preview 31 | 32 | vscode: 33 | extensions: 34 | - ms-python.python 35 | 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Gitpod 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------