A flask-driven restful API for PetRego pet registration service.
- Python3 - Version 3 of the Python programming language
- Flask - A microframework for web application development written in Python programming language
- SQLite - A small and self-contained SQL database engine.
-
You need Python3 installed on your computer. On OpenSuse Linux, e.g., you can install Python3 as follows:
$ sudo zypper install python3
-
Details for other platforms can be found on the Python website.
-
Once you have install Python, you might want to create a virtual environment.
$ python3 -m venv <your_venv_name>
-
For the rest of this document, we will assume you have activated your virtual environment.
$ source </path/to/your/venv>/bin/activate
-
Git clone this repo to your PC
$ git clone git@github.com:haroon/petrego.git
-
-
CD into the cloned repo
$ cd petrego
-
Install dependencies:
$ pip install -r requirements.txt
-
-
Set up FLASK environment:
$ export FLASK_APP=petrego
-
Initialize the database by issuing following command
$ flask init-db
-
On your terminal, run the app with following command:
$ flask run
You can access the help (this document) by going to
http://localhost:5000/help/about/
API documentation can be accessed at (replace the version after /api/ to the API version of your choice):
-
This app uses Python's unittest framework. You can test the application by running the following command:
$ python3 -m unittest discover tests