DEV Community

Cover image for Building a CRM Web App With Python

Posted on • Updated on

Building a CRM Web App With Python

What motivated me build this web app is my desire to be able to have a personal form app built with my own desired questions and database structure.

It took me a while to finally put this few lines of code together, but i am glad i did.

This CRM Web App, is built with python programming, streamlit and Deta Base an open source data base structure that allows you store your data in a JSON Format.

Importing Necessary Libraries For Our App

import streamlit as st
import pandas as pd
from deta import Deta
import json
import base64
Enter fullscreen mode Exit fullscreen mode

Our Form Codes

st.header("Pink Data Hub CRM")

pink_data = st.sidebar.selectbox("choose:",("Chose","Database", "Database Connection"))

deta = Deta(st.secrets["deta_key"])

db = deta.Base("CRM-Records")

if pink_data == "Database":
          with st.form("Submit", clear_on_submit=True):
               id_name = st.text_input("Company's ID")
               name = st.text_input("Company's Name")
               phone = st.text_input("Company's Phone Number")
               email = st.text_input("Company's Email Address")
               location = st.text_input("Company's Location")
               submitted = st.form_submit_button("Submit")
               if submitted:
                     db.put({"company_id":id_name, "company_name":name, "email_address":email, "location":location})


Enter fullscreen mode Exit fullscreen mode

To View Your Collected Data

if pink_data ==  'Database Connection':
    db_content = db.fetch().items

Enter fullscreen mode Exit fullscreen mode

To retrieve your stored database in DETA BASE here are links to do so


Here is the repo to this project

You can deploy your app to Streamlit Cloud

Discussion (0)