Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sintef/restapi-flask-python-template
Template for starting a Flask/Python Rest API
https://github.com/sintef/restapi-flask-python-template
Last synced: about 2 months ago
JSON representation
Template for starting a Flask/Python Rest API
- Host: GitHub
- URL: https://github.com/sintef/restapi-flask-python-template
- Owner: SINTEF
- License: mit
- Created: 2020-09-30T06:47:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T02:07:42.000Z (almost 2 years ago)
- Last Synced: 2023-03-04T04:57:17.751Z (almost 2 years ago)
- Language: HTML
- Size: 109 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flask/Python Service Template
This is a template for building modular web services with a
best-practice organization of files, build environment, static
analysis etc. The template can be used as a starting point for
creating your own services.## Visual Studio Code extensions
* Docker: ms-azuretools.vscode-docker
* Swagger Viewer: arjun.swagger-viewer
* OpenAPI Preview: zoellner.openapi-preview
* Remote - Containers: ms-vscode-remote.remote-containers
* Python - ms-python.python
Recommended:
* Live Share: ms-vsliveshare.vsliveshare
* YAML: redhat.vscode-yaml## Run in local environment
$ python3 -m venv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ pip install -r requirements-test.txt
$ export FLASK_APP=wsgi.py
$ export FLASK_ENV=development
$ flask run## Run in docker
Build the development target, either from the command line or by the
Docker plugin in Visual Studio Code (from VSC Right Click on the
Dockerfile and select "Build Image..."docker build --rm -q -f Dockerfile \
--label "sintef.testservice-target=development" \
--target development \
-t "sintef/testservice-development:latest" .### Run from the VSC envionment
From VSC reopen the folder in Container ('F1' | Remote-Containers: Open
Folder in Container)### Run from command line
docker run -it --rm -d -p 5000:5000 sintef/testservice-development:latest