- Python 3
- Virtualenv
- Flask
git clone git@github.com:milktea/planet.git
Navigate to the app directory.
cd planet
virtualenv -p python3 venv
. venv/bin/activate source
To install the project with all the requirements and create the database, run:
make init
Installing Flask and other dependencies
Create the database (Running the instance later will automatically setup the database schema.)
Databases created: planet and planet_test
Configure your tunnel to forward to localhost:5000. To run the development server, run:
Export
export FLASK_APP=planet
export FLASK_ENV=development
Run the app
flask run
or
make serve
You should be able to access the application on this sample endpoint http://localhost:5000/persons/1
To import
flask db_seed
To drop data
flask db_drop
make test
or run the basic test suite with:
pytest -v planet/tests/
e.g
pytest -v planet/tests/test_company.py -k test_add_company
Get company employees : /companies/<int:company_id>/employees
Get person info: /persons/<int:person_id>
Get 2 persons mutual friends: /persons/<int:person_id>/mutual_friends/<int:friend_id>
- [Flask] - The web framework used
- milktea