newtonkiragu / mfsAfricaAssesment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MFS Africa Assessment

Description

An application interface that receives a string of comma separated points and calculates the closest points.

Link to deployed site

http://mfsafrica-karanu.herokuapp.com

Table of content

  1. Description
  2. API endpoints
  3. Setup and installations
  4. Testing
  5. Contact me
  6. Licensing

endpoints

API Endpoint Description Request
http://mfsafrica-karanu.herokuapp.com/points/ Display a JSON object containing all comma separated points GET
http://mfsafrica-karanu.herokuapp.com/points/ Create a new list of points POST
http://mfsafrica-karanu.herokuapp.com/points// Display a JSON object of a specific point containing the calculation of the closest point GET
http://mfsafrica-karanu.herokuapp.com/points// Edit a comma separated point PUT
http://mfsafrica-karanu.herokuapp.com/points// Delete a comma separated point DELETE

Setup and installations

Prerequisites

  1. Python3.9
  2. virtualenv
  3. Pip
  4. Django
  5. Django Rest Framework

Technologies used

- Python 3.9
- Heroku
- SQLite
- Django, Django Rest Framework

Clone the Repo and checkout into the project folder.

git clone git@github.com:newtonkiragu/mfsAfricaAssesment.git && cd mfsAfricaAssesment

Create and activate the virtual environment

python3.9 -m virtualenv virtual
source virtual/bin/activate

Setting up environment variables

Create a .env file and paste the following filling where appropriate:

SECRET_KEY='<Secret_key>'
DEBUG=True
DISABLE_COLLECTSTATIC=1

Install dependencies

Install dependencies that will create an environment for the app to run pip install -r requirements.txt

Run migrations

python3.9 manage.py migrate

Run the app

python3.9 manage.py runserver

Open localhost:8000

Testing

To run the tests, run

python3.9 manage.py test

Support and contact details

Contact Newton Karanu for further help/support

License

MIT

Copyright (c) 2021 Newton Karanu

About

License:MIT License


Languages

Language:Python 100.0%