zamuzakki / django-geoloc-leaflet

Geo location Django with django-leaflet and django-bootstrap4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django Geolocation using POSTGIS


installation on macOS

  • brew install psql
  • brew install gdal
  • brew install libgeoip

or using docker image -> kartoza postgis https://hub.docker.com/r/kartoza/postgis/


go to psql CLI:

  • psql

create database postgis and create extension postgis

  • postgres# CREATE DATABASE djangogis;
  • postgres# CREATE EXTENSION postgis;

create user and password

  • postgres# \c djangogis
  • postgres# CREATE USER admingis WITH PASSWORD 'qwerty123456'

create venv

  • python3 -m venv venv

activate venv

  • venv/bin/activate

install module

  • pip install -r requirements.txt

migration db

  • python manage.py makemigrations
  • python manage.py migrate

create superuser

  • python manage.py createsuperuser

run django

  • python manage.py runserver

run test

Create database superuser, alter the user’s role from the SQL shell

  • postgres# ALTER ROLE admingis SUPERUSER

run test in terminal

  • python manage.py test

IMAGE ALT TEXT HERE

About

Geo location Django with django-leaflet and django-bootstrap4


Languages

Language:Python 68.4%Language:HTML 28.4%Language:CSS 3.2%