An Awesome Python and Flask RESTful API Sample/Bootstrap Project with a Touch of OOP and MVC, Unit Testing, Persistence via SQLAlchemy, Security and Authentication, Mashups and some other cool topics in one single package.
This is a work in progress...
Quick steps to get started:
git clone https://github.com/R-H-T/GWLocationAPI.git
virtualenv venv
(Learn more about setting up your own Virtual Environment - read my instructions below: How to Setup a Virtual Environment?)source venv/bin/activate
(Mac/Linux) or ./venv/Scripts/activate.bat
(Windows)pip install -r requirements.txt
python app.py
virtualenv
from your terminal/command promptMac/Linux/Windows:
pip install virtualenv
or
pip3.6 install virtualenv
virtualenv
This will initialize virtualenv
within your project's directory.
Mac/Linux/Windows:
virtualenv venv
or
virtualenv venv --python=3.6
virtualenv
This will activate your virtual environment.
All pip install
s inside your project directory
will only affect your virtual environment and not your system.
Mac & Linux:
source venv/bin/activate
Windows:
./venv/Scripts/activate.bat
virtualenv
This will stop your virtual environment session.
While you're inside your project's directory, type the following (Mac/Linux/Windows):
deactivate
cURL
curl "https://gw-location-api.herokuapp.com"
curl "https://gw-location-api.herokuapp.com/find/bangkok"
curl "https://gw-location-api.herokuapp.com/locations/"
curl "https://gw-location-api.herokuapp.com/locations/1"
curl -i -X "POST" "https://gw-location-api.herokuapp.com/locations/"
curl -i -X "PUT" "https://gw-location-api.herokuapp.com/locations/1"
curl -i -X "DELETE" "https://gw-location-api.herokuapp.com/locations/1"
? = Requires authentication (Create a user inside the generated db-file until added in future versions).
Run python tests/model/test_user.py
https://gw-location-api.herokuapp.com
Copyright ©2018 – Roberth Hansson-Tornéus (R-H-T)