Building an emergency location sharing app in Django (part - 1)

Setting up ...

This article is for the people with similar goals who are new to Django, we will do all prerequisites which are required to build the emergency app. 

Step-1 : Installing and Configuring Django 

Step-2 : Installing Required packages 

Step-3 : Starting and Running the project 

So, let's start...

1 . Installing and Configuring Django

        sudo apt update -y

This command downloads the package information which is useful to get information on
an updated version of packages or their dependencies. So, what it does is, install new
packages if required to satisfy the dependencies but existing packages will never be
removed they may get updated.
sudo apt install python3

sudo apt install python3 python3-pip -y
If you are using ubuntu version 16.10 or newer then these are the two commands to
install python3 and pip3.

python3 --version

pip3 --version

Once the installation is done check the installation by running the last two commands.

pip3 install Django

Install django on ubuntu version 16.10 or newer version, to check the installation status run the following command

django-admin --version

python3 manage.py createsuperuser

First we need to create who can login to the admin site
Enter username press Enter
Enter EmailId press Enter
You will be asked to enter your password twice, the second time as a confirmation of the first.This is how it looks like
         

2 . Installing Required packages 

        pip3 install geopy

Its a python client for several popular Geocoding webservices geopy makes it easy for all python developers to locate             the coordinates of addresses,cities,countries and landmarks across the globe using third party geocoders and other data             sources
 
          pip3 install geocoder

It is a simple consistent geocoding library return in python mainly used by online providers such as Google and Bing               having geocoding services.These providers do not include python libraries and have different Json responses between            each other
For the reference you can go through this link : https://pypi.org/project/geocoder/
    

3 . Starting and Running the project 

       Let’s create a new Django project
  
       django-admin startproject <projectname>

      This is how project structure looks like 
 



          
       The project name is "sharelocation" which contains five files as shown. 

         Let’s start the development server .

      python3 manage.py makemigrations

      python3 manage.py migrate     

python3 manage.py runserver




       Now, open a Web browser and run http://127.0.0.1:8000/. This is the website of our project and it looks like this for the           first time.


                       
            So we have successfully created the project. Lets, build it !! 

Comments

  1. What is the purpose of this app. How this is going to help the users

    ReplyDelete
  2. The purpose of this app is to help public in emergency situations, so when a user is in emergency situation he / she can intimate police and known members by sharing their locations and kind of emergency

    ReplyDelete

Post a Comment

Popular posts from this blog

Building an emergency location sharing app in Django (part - 2)

What and Why Haskell ?

Building an emergency location sharing app in Django (part - 3)