# CRM (Django)

A free, open-source CRM for small B2B sales teams of 3 to 15 people, built with Django 5.2 LTS, Python 3.12, PostgreSQL, htmx and Tailwind CSS. It covers companies, contacts and deals on a pipeline board you drag or move from a menu, one timeline of calls, emails, meetings and notes, follow-up tasks with a Today list, win and loss reasons, reports and CSV import and export.

- Framework: Django (Python)
- Category: Apps / CRM
- Creates: a server app and a PostgreSQL database on the Shared tier (1 GB)
- Plan: Lite or above
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/apps/crm/crm-template-django
- Updated: 2026-11-21

## Features

- Deals board by stage with a count and total per column and days in stage; drag a card, or use its Move menu from a keyboard, screen reader or phone
- Won and lost with a reason and an optional note; closed deals stay on the board for 30 days and can be reopened
- One timeline of calls, emails, meetings and notes per deal, contact and company, logged in place with htmx, with stage changes added by themselves
- Follow-up tasks with a due date and an owner, and a Today page with overdue and due tasks, the next seven days and deals closing soon
- Reports on open pipeline by stage and owner, value won per month, team activity, 90-day win rate and win and loss reasons, each chart with a table
- CSV import that understands Excel, Outlook, Google Contacts and HubSpot headers and skips emails already in the CRM, and formula-safe CSV export
- One team per install: the first sign-up is the owner and Django admin, others join by single-use invitation as member or admin
- A Denver Commercial HVAC demo with 16 companies, 32 contacts and 35 deals in dollars, removed in one click, and WCAG 2.2 AA in light and dark

## What you need

- A paid plan: deploying creates a PostgreSQL database, which the Free plan does not include
- To run it locally: Python 3.12 with pip, and Docker for a local PostgreSQL; the CSS build downloads the Tailwind CLI once
- No API keys: it starts with nothing to configure, and emails are printed to the server log
- Optional: RESEND_API_KEY and EMAIL_FROM to email invitations and password resets
- Optional: GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, or the GOOGLE_ pair, for GitHub or Google sign-in

## About

Pipeline stages and win and loss reasons are in crm/constants.py, the dollar sign in core/templatetags/ui.py and crm/forms.py, the time zone in TZ (America/Denver by default), and the landing page and FAQ in templates/core/landing.html and core/content.py. On start config/wsgi.py takes a PostgreSQL advisory lock, applies migrations and seeds the demo once; whoever signs up first becomes the owner and takes over the demo, and after that sign-up needs an invitation, so create the owner account straight after deploying. It is one team per install, without the separate workspaces and paid seat plans of the Next.js CRM, search is a plain text match rather than full-text search, and on touch screens cards move with the Move menu because dragging is mouse only. Email through Resend is built but has not been tested with a real key. Emailed and absolute links use APP_URL, which Light Cloud sets at each deploy; on other hosts set it yourself, because otherwise links follow the X-Forwarded-Host header the app trusts.

## Variables

- `DJANGO_SECRET_KEY`: generated

## Questions

### Is there a free open-source CRM built with Django?

Yes. This CRM is MIT licensed and built with Django 5.2 LTS, PostgreSQL and htmx. It has a deal pipeline, contacts and companies, a timeline, tasks, reports and CSV import, with no limit on users or records.

### How do I import contacts from Excel or HubSpot into a Django CRM?

Save the sheet as CSV and use Contacts, Import CSV as an owner or admin. It recognises Excel, Outlook, Google Contacts and HubSpot column names, accepts commas or semicolons, creates companies by name and skips emails already in the CRM.

### How do I change the pipeline stages?

Edit the Stage choices and OPEN_STAGES in crm/constants.py. The board, the list, the deal form and the reports read from there; Won and Lost are the two closing stages, and their reasons are WIN_REASONS and LOSS_REASONS in the same file.

### Does the CRM need JavaScript or Node.js?

Not at runtime. Pages are rendered by Django and htmx adds in-place updates; every action is also a normal form. Tailwind CSS is compiled once with its standalone CLI when the Docker image is built.

### Can I self-host this Django CRM without Light Cloud?

Yes. It has no Light Cloud code: build the Dockerfile on any Docker host, or run pip install, the Tailwind script, collectstatic and gunicorn config.wsgi:application, with DATABASE_URL and DJANGO_SECRET_KEY set.
