is a built-in application that is included as a contrib module in Django. It’s actually a complete framework itself that can also be used separately from Django. It provides a toolbox of utilities for building GIS web applications. GeoDjango Purpose of this tutorial Nothing much fancy, here we are getting co-ordinates(Longitude, Latitude) of location by inputting names of country and city. : Requirements extension needs to be installed on postgres Postgres postgis GeoDjango Dependencies or install Geospatial libraries , QGIS GEOS, GDAL, and PROJ.4 Note: above requirements need to be installed on your machine separately before continuing Project setup: $ mkdir dj_gis && dj_gis $ python3 -m venv env $ env/bin/activate $ pip install django djangorestframework django-leaflet geopy psycopg2-binary $ django-admin.py startproject config $ python manage.py startapp location cd source config/settings.py INSTALLED_APPS = [ , , , ] #config/settings.py "django.contrib.gis" "location" "rest_framework" config/urls.py #config/urls.py django.contrib admin django.urls path django.urls.conf include urlpatterns = [ path( , admin.site.urls), path( , include( )), ] from import from import from import "admin/" "api/v1/" "location.urls" include file on app url.py location #location/urls.py django.urls path urlpatterns = [] from import So we finished basic setups Let's create a model location/models.py django.db models django.contrib.gis.db models name = models.CharField(max_length= ) address = models.CharField(max_length= ) created_at = models.DateTimeField(auto_now_add= ) updated_at = models.DateTimeField(auto_now= ) location = models.PointField(null= ) self.name from import from import # GeoDjango Model API : class Hotel (models.Model) 255 255 True True True # Spatial Field Types -> str: def __str__ (self) return here, we include a spatial field of geo django model api. pointfield let's create a and for our model. serializer views # location/serializers.py location.models Hotel rest_framework serializers = Hotel fields = ( , , , ) extra_kwargs = { : { : True}} from import from import ( . ): : class HotelSerializer serializers ModelSerializer class Meta model "id" "name" "address" "location" "location" "read_only" location/views.py rest_framework generics .models Hotel django.contrib.gis.geos Point geopy.geocoders Nominatim geolocator = Nominatim(user_agent= ) = Hotel.objects.all() serializer_class = HotelSerializer def perform_create(self, serializer): address = serializer.initial_data[ ] g = geolocator.geocode(address) lat = g.latitude lng = g.longitude pnt = Point(lng, lat) print(pnt) serializer.save(location=pnt) = Hotel.objects.all() serializer_class = HotelSerializer def perform_update(self, serializer): address = serializer.initial_data[ ] g = geolocator.geocode(address) lat = g.latitude lng = g.longitude pnt = Point(lng, lat) print(pnt) serializer.save(location=pnt) from import from import from import from import "location" ( . ): class ListCreateGenericViews generics ListCreateAPIView queryset "address" ( . ): class HotelUpdateRetreiveView generics RetrieveUpdateDestroyAPIView queryset "address" Note: above can be further refactor using or your desired ones. view viewsets so, library comes in handy, which is is a Python client for several popular geocoding web services. geopy makes it easy for Python developers to locate the coordinates of addresses, cities, countries, and landmarks across the globe using third-party geocoders and other data sources. geopy let's update our urls: #location/urls.py django.urls path .views HotelUpdateRetreiveView, ListCreateGenericViews urlpatterns = [ path( , ListCreateGenericViews.as_view()), path( , HotelUpdateRetreiveView.as_view(), ), ] from import from import "hotels" "hotels/<str:pk>" Creating a Database: sudo -u postgres psql CREATE DATABASE locator; CREATE USER locator WITH PASSWORD ; CREATE EXTENSION postgis; ALTER ROLE locator SET client_encoding TO ; ALTER ROLE locator SET default_transaction_isolation TO ; ALTER ROLE locator SET timezone TO ; ALTER ROLE locator SUPERUSER; GRANT ALL PRIVILEGES ON DATABASE locator TO locator; 'locator' 'utf8' 'read committed' 'UTC' let's make some changes on our settings.py INSTALLED_APPS = [ , , , , , , , , , , ] DATABASES = { : { : , : , : , : , : , : , } } LEAFLET_CONFIG = { # : ( , , , ), : ( ), #set your corordinate : , : , : , : , : , : , } "django.contrib.admin" "django.contrib.auth" "django.contrib.contenttypes" "django.contrib.sessions" "django.contrib.messages" "django.contrib.staticfiles" "django.contrib.gis" "location" "rest_framework" "leaflet" "default" "ENGINE" "django.contrib.gis.db.backends.postgis" "NAME" "locator" "USER" "locator" "PASSWORD" "locator" "HOST" "localhost" "PORT" "5432" "SPATIAL_EXTENT" 5.0 44.0 7.5 46 "DEFAULT_CENTER" 13.3888599 52.5170365 "DEFAULT_ZOOM" 16 "MIN_ZOOM" 3 "MAX_ZOOM" 20 "DEFAULT_PRECISION" 6 "SCALE" "both" "ATTRIBUTION_PREFIX" "powered by me" Registering model on admin django.contrib admin leaflet.admin LeafletGeoAdmin .models Hotel @admin.register(Hotel) = ( , , , , , ) from import from import from import ( ): class HotelAdmin LeafletGeoAdmin list_display "id" "name" "address" "location" "created_at" "updated_at" so, we have added leaflet, leaflet_config and database. For more about Leaflet you can visit Read the docs let's run our app: python manage.py makemigrations python manage.py migrate python manage.py createsuperuser python manage.py runserver here, what you get on the admin panel. Let's add some data using browsable api or you can use postman too. Try it out yourself for update and delete You can find the code in github . repo