No description
  • Python 84.5%
  • HTML 14.5%
  • CSS 0.7%
  • Dockerfile 0.3%
Find a file
2026-05-24 06:54:01 +00:00
.woodpecker fix double testing 2026-05-23 21:32:29 -07:00
attendee optional add ons and cents digits 2026-05-23 21:08:24 -07:00
badges Add copy pricing schedule action, fix PricingTier validation, pull image from registry 2026-05-23 00:48:54 -07:00
cart attendee buildout 2026-05-20 22:21:00 -07:00
config Add STATICFILES_DIRS so Django serves project-level static files 2026-05-23 01:02:58 -07:00
events attendee buildout 2026-05-20 22:21:00 -07:00
marketplace scaffold apps 2026-05-19 22:44:22 -07:00
payments attendee buildout 2026-05-20 22:21:00 -07:00
staff scaffold apps 2026-05-19 22:44:22 -07:00
static_src labb refactor 2026-05-20 22:46:02 -07:00
templates Add copy pricing schedule action, fix PricingTier validation, pull image from registry 2026-05-23 00:48:54 -07:00
tenants docker and allauth 2026-05-18 23:56:39 -07:00
tests fix tests 2026-05-23 21:29:36 -07:00
.env.example multi-tenant 2026-05-18 22:26:36 -07:00
.gitignore Add copy pricing schedule action, fix PricingTier validation, pull image from registry 2026-05-23 00:48:54 -07:00
.python-version gitignore 2026-05-18 22:27:52 -07:00
conftest.py attendee buildout 2026-05-20 22:21:00 -07:00
docker-compose.yml optional add ons and cents digits 2026-05-23 21:08:24 -07:00
Dockerfile non-root 2026-05-21 10:19:38 -07:00
labb.yaml install labb 2026-05-18 22:34:54 -07:00
manage.py multi-tenant 2026-05-18 22:26:36 -07:00
package-lock.json install labb 2026-05-18 22:34:54 -07:00
package.json install labb 2026-05-18 22:34:54 -07:00
pyproject.toml attendee buildout 2026-05-20 22:21:00 -07:00
README.md docker and allauth 2026-05-18 23:56:39 -07:00
uv.lock attendee buildout 2026-05-20 22:21:00 -07:00

mndr_reg

A multi-tenant Django 6 application using django-tenants with a labb component UI layer (Tailwind CSS + daisyUI 5).

Tech Stack

  • Python 3.12+
  • Django 6.0
  • django-tenants — PostgreSQL schema-based multi-tenancy
  • labb (labbui + labbicons) — Django Cotton component library
  • Tailwind CSS 4.2 + daisyUI 5 — styling
  • uv — Python package manager

Prerequisites

  • Python 3.12.1+
  • PostgreSQL
  • Node.js (for Tailwind CSS builds)
  • uv

Getting Started

1. Clone the repo

git clone ssh://git@git.mndr.me:222/meander/mndr-reg.git
cd mndr_reg

2. Install Python dependencies

uv sync

3. Install Node dependencies

npm install

4. Configure environment

cp .env.example .env

Edit .env with your settings:

DEBUG=True
SECRET_KEY=your-secret-key
DATABASE_URL=postgres://postgres:postgres@localhost:5432/mndr_reg

5. Create the database

createdb mndr_reg

6. Run migrations

uv run python manage.py migrate_schemas --shared

7. Create the public tenant

uv run python manage.py create_public_tenant

8. Run the development servers

In one terminal, start the CSS watcher:

uv run labb dev

In another terminal, start Django:

uv run python manage.py runserver

Project Structure

mndr_reg/
├── config/             # Django project settings, URLs, WSGI/ASGI
├── tenants/            # Multi-tenancy app (Tenant & Domain models)
├── templates/          # Global templates
├── static_src/         # Tailwind CSS input
├── labb.yaml           # labb CSS build configuration
├── pyproject.toml      # Python dependencies (uv)
└── package.json        # Node dependencies (Tailwind, daisyUI)

Multi-Tenancy

This project uses PostgreSQL schema-based tenancy via django-tenants. Each tenant gets its own schema with isolated data. The public schema holds shared tables (tenants, domains).

  • Tenant model: tenants.Tenant
  • Domain model: tenants.Domain

Tenants are routed by domain — the TenantMainMiddleware resolves the current tenant from the request host.

Managing Tenants

Create a superuser in the public schema to manage tenants via the admin:

uv run python manage.py tenant_command createsuperuser --schema=public

Then log in at http://localhost:8000/admin/ to create and manage tenants and domains.

Order of operations: Create a Tenant first, then assign Domain(s) to it. The admin form lets you do both in one step via the inline.

Creating Users in a Specific Tenant

Each tenant has its own user table. To create a superuser within a tenant's schema:

uv run python manage.py tenant_command createsuperuser --schema=acme

Local Domain Routing

For local development, add tenant domains to /etc/hosts:

127.0.0.1  acme.localhost

Then assign acme.localhost as the domain for that tenant in the admin. Access it at http://acme.localhost:8000.

labb UI

Components use Django Cotton syntax (<c-lb.component>). Run labb dev during development to watch templates and rebuild CSS automatically.

Useful CLI commands:

labb components inspect <component>   # View component specs
labb components ex <component>        # View usage examples
labb icons search "term"              # Search available icons