1
- # Project Purpose
1
+ # Django Reference Implementation
2
+
3
+ <div style =" text-align : center ;" >
4
+
5
+ ![ Django] ( https://img.shields.io/badge/Django-5.1-green.svg )
6
+ ![ Python] ( https://img.shields.io/badge/Python-3.12-blue.svg )
7
+ ![ PostgreSQL] ( https://img.shields.io/badge/PostgreSQL-16-blue.svg )
8
+ ![ License] ( https://img.shields.io/badge/License-MIT-yellow.svg )
9
+ ![ Tests] ( https://img.shields.io/badge/Tests-Passing-brightgreen.svg )
10
+ ![ Ruff] ( https://img.shields.io/badge/Linting-Ruff-purple.svg )
11
+
12
+ ** Production-ready Django SaaS template with organizations, invitations, and solid authentication built-in.**
13
+
14
+ [ Features] ( #features ) • [ Quick Start] ( #quick-start ) • [ Architecture] ( #architecture ) • [ Why This Template?] ( #why-this-template ) • [ Documentation] ( #documentation ) • [ Contributing] ( #contributing ) • [ License] ( #license )
15
+
16
+ </div >
17
+
18
+ ## Project Purpose
2
19
This project is a reference implementation for a production-ready Django
3
20
application with common use cases baked in. It is the base application that
4
21
Simple CTO uses for its projects, and we hope that it can be helpful to you.
@@ -9,39 +26,64 @@ build applications, and this is ours. You are welcome to fork, copy, and
9
26
imitate. We stand on the shoulders of giants, and you are welcome to as
10
27
well.
11
28
12
- ---
13
-
14
- # Getting Started
29
+ ## 🚀Quick Start
15
30
16
31
You are impatient, I get it. Here is the [ quick start guide] ( docs/getting_started.md ) .
17
32
18
- ---
19
-
20
- # Use cases covered
33
+ ## 🌟 Features
21
34
You will see a number of use cases covered:
22
35
23
- * Async tasks (sending email, health-check PUSH)
24
- * Viable alternatives to Celery
25
- * Sending e-mail (with SMTP)
26
- * User Login, Logout, Registration, password reset (email, social)
27
- * 2FA enabled by default
28
- * Admin interface customization
29
- * Health-check (HEAD/GET used by Load Balancers)
30
- * Simple template tags (quick image thumbnails)
31
- * Serving static assets from Django vs. needing nginx/apache
32
- * Storing assets in S3 (optional)
33
- * Local development using PyCharm and/or Docker
34
- * Command line automation with ` Makefile `
35
- * Deployment with Docker and Docker Compose
36
- * Deployment to Heroku, Dokku, etc using ` Procfile `
37
- * Opinionated linting and formatting with ruff
38
- * Configuration and worker management inside the admin interface
39
- * Default pages for privacy policy, terms of service
40
- * Uses bootstrap icons
36
+ - ** Organizations with Multi-tenancy** - Create, manage, and collaborate in organizations with fine-grained permissions
37
+ - ** User Invitation System** - Complete invitation lifecycle with email notifications and secure onboarding
38
+ - ** Modern Authentication** - Email verification, social logins, MFA/2FA support via django-allauth
39
+ - ** Asynchronous Task Processing** - Simple worker pattern using PostgreSQL (no Celery/Redis/RabbitMQ required)
40
+ - ** Docker-based Development** - Consistent development environment with Docker Compose
41
+ - ** Production Ready** - Configured for deployment to Dokku or similar platforms
42
+ - ** Strict Code Quality** - Ruff linting with strict settings, pre-commit hooks, GitHub Actions workflow
43
+ - ** Comprehensive Testing** - Unit and integration tests covering critical functionality
44
+ - ** Bootstrap 5 UI** - Clean, responsive interface with dark mode support
45
+ - ** Admin interface customization** - Custom admin views for managing data
46
+ - ** Health-check** - HEAD/GET used by Load Balancers and other services
47
+ - ** Simple template tags** - Custom template tags for rendering common UI elements
48
+ - ** Serving static assets** - from Django vs. needing nginx/apache
49
+ - ** Storing assets in S3** - (optional)
50
+ - Local development using PyCharm and/or Docker
51
+ - Command line automation with ` Makefile `
52
+ - Deployment with Docker and Docker Compose
53
+ - Deployment to Heroku, Dokku, etc using ` Procfile `
54
+ - Opinionated linting and formatting with ruff
55
+ - Configuration and worker management inside the admin interface
56
+ - ** Default pages** - for privacy policy, terms of service
41
57
42
- ---
43
58
44
- # Project Principles
59
+ ## 🏗️ Architecture
60
+
61
+ This Django Reference Implementation follows a pragmatic approach to building SaaS applications:
62
+
63
+ - ** Core Apps** :
64
+ - ` myapp ` : Base application with site configuration models and templates
65
+ - ` organizations ` : Complete multi-tenant organization system with invitations
66
+
67
+ - ** Authentication** : Uses django-allauth for secure authentication with 2FA support
68
+
69
+ - ** Async Processing** :
70
+ - Custom worker pattern using Django management commands
71
+ - Uses PostgreSQL as a task queue instead of complex message brokers
72
+ - Simple to deploy, monitor, and maintain
73
+
74
+
75
+ ## 🤔 Why This Template?
76
+
77
+ Unlike other Django templates that are either too simplistic or bloated with features, this reference implementation:
78
+
79
+ - ** Solves Real Business Problems** - Built based on actual production experience, not theoretical patterns
80
+ - ** Minimizes Dependencies** - No unnecessary packages that increase complexity and security risks
81
+ - ** Focuses on Multi-tenancy** - Organizations and team collaboration are first-class citizens
82
+ - ** Balances Structure and Flexibility** - Opinionated enough to get you started quickly, but not restrictive
83
+ - ** Production Mindset** - Includes monitoring, error handling, and deployment configurations
84
+
85
+
86
+ ## Project Principles
45
87
46
88
* Use as little abstraction as possible. It should be easy to trace the code
47
89
paths and see what is going on. Therefore, we will not be using too
@@ -59,11 +101,11 @@ You will see a number of use cases covered:
59
101
* SMTP Credentials
60
102
* S3 Credentials (optional)
61
103
62
- ---
63
104
64
- # Customizing the docker-compose.yml
65
105
66
- ## Adding more workers
106
+ ## Customizing the docker-compose.yml
107
+
108
+ ### Adding more workers
67
109
68
110
Below is the text used for adding a worker that sends SMS messages.
69
111
@@ -77,14 +119,13 @@ These workers are actually Django management commands that are run in a loop.
77
119
env_file: env.sample
78
120
```
79
121
80
- ---
81
122
82
- # Developing locally
123
+ ## Developing locally
83
124
PyCharm's integration with the debugger and Docker leaves some things to be desired.
84
125
This has changed how I work on the desktop. In short, I don't use docker for the django
85
126
part of development. I use the local development environment provided by MacOS.
86
127
87
- ## My Preferred developer stack
128
+ ### My Preferred developer stack
88
129
89
130
* [ PyCharm] ( https://jetbrains.com/pycharm/ ) (paid but community version is good, too)
90
131
* [ Postgres] ( https://postgresql.org ) installed via homebrew or docker
@@ -96,12 +137,12 @@ part of development. I use the local development environment provided by MacOS.
96
137
97
138
---
98
139
99
- # Other Django Template Projects
140
+ ## 🔄 Similar Projects
100
141
Thankfully there are many other Django template projects that you can use.
101
142
We all take inspiration from each other and build upon the work of others.
102
143
If this one is not to your taste, then there are others to consider:
103
144
104
- ## Free / OpenSource
145
+ ### Free / OpenSource
105
146
* [ cookiecutter-django] ( https://github.com/cookiecutter/cookiecutter-django )
106
147
* [ django-superapp] ( https://github.com/django-superapp/django-superapp )
107
148
* [ SaaS Boilerplate] ( https://github.com/apptension/saas-boilerplate )
@@ -112,23 +153,34 @@ If this one is not to your taste, then there are others to consider:
112
153
* [ Quickscale] ( https://github.com/Experto-AI/quickscale )
113
154
* [ Hyperion] ( https://github.com/eriktaveras/django-saas-boilerplate )
114
155
115
- ## Paid
156
+ ### Paid
116
157
* [ SaaS Pegasus] ( https://www.saaspegasus.com/ )
117
158
* [ SlimSaaS] ( https://slimsaas.com/ )
118
159
* [ Sneat] ( https://themeselection.com/item/sneat-dashboard-pro-django/ )
119
160
120
161
* NOTE: These are not endorsements of these projects. Just examples of other
121
162
ways to get started with Django.*
122
163
123
- ---
164
+ ## 📚 Documentation
165
+
166
+ - [ Getting Started Guide] ( docs/getting_started.md )
167
+ - [ Manifesto] ( docs/manifesto.md )
168
+ - [ Organizations] ( src/organizations/docs/README.md )
169
+ - [ Asynchronous Tasks] ( docs/async_tasks.md )
170
+
124
171
125
- # Contributing
172
+ ## 🤝 Contributing
126
173
127
174
Contributions are welcome. Simply fork, submit a pull request, and explain
128
175
what you would like to fix/improve.
129
176
130
- ---
177
+ ## 📜 License
178
+
179
+ [ MIT License] ( LICENSE )
131
180
132
- # License
181
+ ---
133
182
134
- This code is under the MIT License
183
+ <div style =" text-align : center ; margin-top : 20px ;" >
184
+ <p >If this project helps you, please consider giving it a star ⭐</p >
185
+ <p >Developed and maintained by <a href =" https://simplecto.com " >SimpleCTO</a ></p >
186
+ </div >
0 commit comments