https://github.com/systangotechnologies/flaskboilerplate
https://github.com/systangotechnologies/flaskboilerplate
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/systangotechnologies/flaskboilerplate
- Owner: SystangoTechnologies
- Created: 2020-01-28T10:05:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-06T20:02:19.000Z (about 5 years ago)
- Last Synced: 2025-03-22T18:11:47.060Z (about 1 year ago)
- Language: Python
- Size: 45.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# APIs with Flask and MongoDB
### Setup
## Installation in Ubuntu
1. Install python3.7:
`sudo apt install software-properties-common`
`sudo add-apt-repository ppa:deadsnakes/ppa`
`sudo apt-get update`
`sudo apt-get install python3.7`
2. Install pip:
`sudo apt install python3-pip`
3. Install pipenv:
`pip3 install --user pipenv`
4. Create virtual environment using pipenv:
`pipenv shell --python python3.7`
5. Activate virtual environment(Not necessary after step 4 but later its needed once environment is deactivated):
`pipenv shell`
6. Install requirements from pipfile.lock:
`pipenv install`
**NOTE:** If you face below error on STEP 4
`pipenv: command not found` the follow the instructions in below link: https://www.ostechnix.com/pipenv-officially-recommended-python-packaging-tool/
**NOTE:** For ubuntu 18 LTS if you face below error on STEP 3
`Traceback (most recent call last):`
`File "/usr/bin/pip3", line 9, in `
`from pip import main`
`ImportError: cannot import name 'main'`
then run below command:
`bash --login` or follow https://superuser.com/questions/1432768/how-to-properly-install-pipenv-on-wsl-ubuntu-18-04
## Quick start
Run following command to start flask server:
`python app.py`
## Running Tests
Run following command to run unit test cases:
`pytest`
run below command to check test coverage:
`pytest --cov=api --cov-report term-missing`