/Django-CRM-Web

Primary LanguageHTMLMIT LicenseMIT

pt-br Python 3.11 Django 4.2

Django Customer Relationship Management

A customer relationship management web application built using Django and Tailwind.

Django-CRM-API

Functionalities

  • Custom login and register authentication
  • Password reset with email
  • Dashboard with navbar and sidebar
  • Custom tables
  • Custom pagination
  • Custom search
  • Custom empty state
  • Custom Django-Admin
  • Excel export
  • Flash messages
  • Tailwind CSS
  • Light and dark theme
  • Responsive
  • Unit testing, integration testing and functional testing(Selenium)
  • Create, read, update, delete(CRUD)

Screenshots

Register and login

Register_Login

Create

Create

Update

Update

Delete confirmation

Delete

Custom pagination

Pagination

Dark and light theme

Theme_Switch

Search and empty state

Search_Empty_State

Excel Export

Export

Responsive

Responsive

Django Custom Admin

Django-Admin

Running locally

Clone the project

git clone https://github.com/bbigbear/Django-CRM-Web.git

Create a virtual environment

# Linux
sudo apt-get install python3-venv    
python3 -m venv .venv
source .venv/bin/activate

# macOS
python3 -m venv .venv
source .venv/bin/activate

# Windows
py -3 -m venv .venv
.venv\scripts\activate

Update the pip

py -m pip install --upgrade pip

Install the dependencies

pip install -r requirements.txt
npm install

Copy the example env file and make the required configuration changes in the .env file

cp .env-example .env

Configure settings.py

# Local Configuration
DATABASES = {
  'default': {
      'ENGINE': os.getenv('DB_ENGINE', 'django.db.backends.sqlite3'),
      'NAME': os.getenv('POSTGRES_DB', BASE_DIR / './db.sqlite3'),
      'USER': os.getenv('POSTGRES_USER', ''),
      'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''),
      'HOST': os.getenv('POSTGRES_HOST', ''),
      'PORT': os.getenv('POSTGRES_PORT', ''),
  }
}

# Deploy - Render Configuration
# DATABASE_URL = os.getenv('DATABASE_URL')
# DATABASES = {
#    'default': dj_database_url.config(),
# }

Compile the Tailwind CSS

npm run build 

Perform the migrations

py manage.py migrate

Seed leads app

py manage.py seed leads --number=50

Start the server

py manage.py runserver

Running the tests

To run the tests, run the following command

coverage run -m pytest 

Test percentage table (htmlcov/index.html)

coverage html

Learnings

Good practice concepts:

(https://learndjango.com/tutorials/django-best-practices-projects-vs-apps).

Python requirements file:

(https://learnpython.com/blog/python-requirements-file/)

Write and run tests:

(https://docs.djangoproject.com/en/4.2/topics/testing/overview/)

Test-Driven Development:

(https://www.browserstack.com/guide/what-is-test-driven-development)

Selenium:

(https://django-selenium.readthedocs.io/en/latest/)

Class Based Views:

(https://docs.djangoproject.com/en/4.2/topics/class-based-views/)

PostgreSQL - Naming Conventions:

(https://www.geeksforgeeks.org/postgresql-naming-conventions/)

Documentation

Python

Django

Tailwind + Flowbite

Django Custom Taiwind