A contact application is a database that collects and stores user contact data. The contact app is a widely used application, similar to the contact application on your mobile phone, that stores data such as user contact names, phone numbers, email addresses, etc. Businesses can use this application to manage their customers' information and store personal contact data.
This tutorial primarily focuses on integrating a contact API in Python using the Django Rest Framework. This application will have functionalities that allow users to create, edit, and delete contact data. While this goes on the backend of the application, we will create the interface of our application using Appsmith's pre-built UI widgets.
Appsmith is a powerful open-source low-code framework for creating internal tools with features such as pre-built UI widgets that connect to multiple data sources: APIs, databases, GraphQL, etc., with support for OAuth 2.0 and CURL.
Appsmith allows you to create web application interfaces with little or no code. You don't need to be a developer to create an application dashboard using Appsmith. Using Appsmith's drag-and-drop UI widgets, we will create a dashboard for our application.
Prerequisites
- Basic knowledge of Python.
- Good understanding of Django
- An Appsmith account
Project setup: Building a contact book API
Creating a virtual environment
We will begin by creating a virtual environment for our project. The essence of a virtual environment is to create a separate environment for all installed packages and dependencies.
The command below shows how to create a virtual environment in your terminal:
pip install virtualenv
virtualenv env
Activate our virtual environment
For Windows:
env\Scripts\activate
For Mac/Linux:
source env/bin/activate
Virtual environment activated!
Cloning a repository
Next, we will be cloning an already existing repository built with the Django Rest Framework. This repo contains a contact application with functionalities that allow users to create, edit, and delete contact data.
To clone the repo, run these lines of code in your terminal:
git clone https://github.com/Anitaachu/contactAPI.git
cd contactAPI
Dependencies installation
Once this is completed, we will be installing a couple of dependencies and packages required for this project using the pip These packages are already contained in your cloned requirements.txt file.
Run this command to create a requirements.txt file and install the packages:
pip install -r requirements.txt
Next, migrate the data to the database and create a superuser. To this by running the following commands:
python manage.py migrate
python manage.py createsuperuser
Testing the application
Next, let's test this application locally, using the following command: python manage.py runserver
In your browser hit the endpoint http://127.0.0.1:8000/. You can also access the admin page using this URL http://127.0.0.1:8000/admin/
Great! Our application is running!🎉
Getting started with Appsmith
With our API up and running, the next phase of this project is creating an interface using Appsmith pre-built widgets and connecting these widgets to our data source (API). We will be doing this by writing some queries that will be implemented with the widgets.
Let’s dive in!
Connecting to a Datasource
It takes a few minutes to connect to a datasource, and you can develop tools on the database of your choosing. You can either connect to a database, an API, or both. For this project, we will connect Appsmith to a deployed API using the API we earlier created. The deployed API can be accessed using this URL: https://contactapp-api.herokuapp.com/
- Ensure the API you intend to connect is already deployed. You can use Heroku or any other deployment service.
Add the URL of your deployed API and click on ‘run'.
Datasource successfully connected!
Now let’s get to work!
Creating a dashboard with the Appsmith widget
With Appsmith, you can build a fully customized interface with no code. Appsmith has many pre-built UI widgets such as tables, forms, buttons, boxes, images, and more, all available to help you create exciting applications.
Let’s begin! Firstly, let's create a table that will display our contact data.
Follow these steps:
- From the widget section, drag and drop the table widget onto the canvas in this manner:
- Edit the default data from the property pane and add the column names as contained in our database. As contained in our database, the column names include "first_name", "last_name", "phone_number", "email", "address", and "birthday."
- Next, edit the Table Data property in Table Widget’s property pane toÂ
{{Contact_API.data}}in other access data from the query.

