Posts

Showing posts from February, 2021

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

Image
Sharing the location... This article tells about how to share the message through WhatsApp and SMS Step-1 : Creating an account in Chat-API Step-2 : Setting the values Step-3 : Running the project  So, let's start... 1 . Creating an account in Chat-API  To send the messages we use Chat-API .  A Chat-API  is an application program interface that provides access to a server infrastructure with the stability and broad features required for real-time  chat  and messaging at a scale suited to your needs from an intimate   conversation  to a massive  chat . After creating an account an access key (token) and instance is assigned for that account, now open the dashboard and store these two values (token and instance).      Step-2 : Setting the values Run the server 3 . Running the Project             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/ .  Thi

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

Image
  Building the App... In this article we will build a basic template of the application and will see how to   get the current location of the user .   Step-1 : Creating an App Step-2 : Building a HomePage So, let's start... 1 . Creating an App Let's create an app in our django project python3 manage.py startapp <appName> Now the directory structure looks like this : To consider the app created in our project, we need to specify the <appName> in INSTALLED_APPS in settings.py of the project. Here, the <appName> is emergencyApp. We are importing include from django.urls and adding a new URL pattern with path ‘home/’ means that we are creating something like http://127.0.0.1:8000/home .In include you need to mention the '<appName>.urls'. Now, we need to create urls.py in <appName> folder. 2 . Building a HomePage           Lets create a home page for the emergency app.Put <filename.html> in template folder