Skip to content

Django-based application for managing and displaying object locations on Google Maps.

Notifications You must be signed in to change notification settings

raffaellasuardini/tesi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mappy

Mappy is a Django application to store and show object location on GoogleMaps .

Requirement

  1. Django (tested on version 3.1)
  2. Python (tested on version 3.8)
  3. Google maps API key with Maps JavaScript API enabled get and API key instruction
  4. Generates a random token to protect list of coords which is used for real-time map inside Django

Installation

  1. clone this project
git clone https://github.com/raffaellasuardini/tesi.git
  1. create a virtual env
python -m venv env
source env/bin/activate
  1. install Django Rest Framework
pip install djangorestframework
  1. install Django-Environment
pip install django-environ
  1. create a .env file like this:
DEBUG=ON
SECRET_KEY=your_secret_key
GOOGLE_MAP_KEY=your_api_key
TOKEN=random_token_for_GET

Usage

To activate server

python manage.py runserver

To apply migration

python manage.py migrate

To collect static

python manage.py collectstatic

To create superuser

python manage.py createsuperuser

API Usage

You can only use POST to insert new coords with a request to the endpoint:

http://YOUR_DOMAIN/api/coord/

If you need a list of coords with GET method use this endpoint with your token:

http://YOUR_DOMAIN/api/coord/list/?token=YOUR_TOKEN

JSON Request format:

{
  object_label: 'label for the point',
  lat: 'latitude',
  lng: 'longitude'
}

If object_label exist API updates coords, else a new one is created.

About

Django-based application for managing and displaying object locations on Google Maps.

Topics

Resources

Stars

Watchers

Forks