Posts

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

What and Why Haskell ?

Image
Haskell  is a modern, standard, functional programming language,  named for  Haskell Brooks Curry , whose work in mathematical logic serves as a foundation for functional languages. In particular it is,  statically and strongly typed, lazy,  purely functional   language which is quite different from most other programming languages. Let's understand this in detail... Purely Functional C, Java, Pascal, Ada, and so on, are all  imperative  languages  which means  that, they consist of a sequence of commands, which are executed strictly one after the other, it focuses on results not the process. Languages like Haskell,  Scala, Clojure, Erlang etc... are functional.  Functional programming (also called FP) is a way of thinking about software construction by creating pure functions, this is used mainly to avoid shared state, mutable data because object with immutable state gives guarantee and trust for all parties consuming it. So, f unctional languages emphasize on expressions and decl

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

Image
Setting up ... This article is for the people with similar goals who are new to Django, w e 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