Python Flask backend
This repository contains boilerplate codes to build an API service using Python Flask.
A sample endpoint for Calculate Square is in this repo, where you can POST
to the API endpoint /square
.
- Go to
square.py
underapp/routes
folder in this template and you will find a post method with name/square
- Write your implementation in this method. This method will be the entry point when you submit your solution for evaluation
- Note the init.py file in each folder. This file makes Python treat directories containing it to be loaded in a module
You will first need to have Python's virtualenv
. Below are the instructions for Windows.
pip install virtualenv
Next up, create the virtual environment.
python -m venv venv
You can run/activate the virtual environment and install the required packages.
.\venv\Scripts\activate
pip install -r requirements.txt
Finally, run the services!
python app.py