Skip to content

thepylot/geolocation-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Geolocation API

Endpoints for geolocation data based on IP or URL

Getting Started

This project works on Python 3+ and Django 2+.

  1. Create free API KEY from https://ipstack.com and update ACCESS_KEY field in .env.dev file with your key.

  2. Build the project by following command:

docker-compose build

and run the containers:

docker-compose up
  1. Create a new user by navigating to http://localhost:8000/api/user/create.

  2. Once a new user created generate JWT token by navigating to http://localhost:8000/api/user/token

  3. Copy the access and put it to your headers like below:

Bearer <YOUR_ACCESS_KEY>

We recommend to use ModHeader extension to manage headers in Chrome

  1. Finally, navigate to http://localhost:8000/api to access endpoints

Endpoints

The endpoints are:

  • /api/locations Retrieves the list of created geolocations and allows to add a new geolocation if the IP address and all required response data exists.
  • /api/locations/<id> Retrieves a particular geolocation object and allows PUT, PATCH and DELETE requests.

Testing

You can run all tests by following command:

docker-compose run app sh -c "python manage.py test"

Live Preview on Heroku

You can visit the link below too see it in production: https://find-geolocation.herokuapp.com/api/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published