Skip to content

Repository files navigation

Operon — IMS System Backend

A modern Django SaaS application scaffold with multi-tenant support, subdomain-based tenant routing, and per-tenant admin dashboards.

Prerequisites

  • Python 3.10+
  • PostgreSQL 14+
  • pip or pipenv

Environment Setup

1. Clone and Create Virtual Environment

git clone <repo-url>
cd operon
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

2. Install Dependencies

pip install -r requirements/dev.txt

pre-commit install

3. Configure Environment Variables

Create a .env file in the project root:

4. Initialize Database

Create the PostgreSQL database:

createdb operon_db

Run shared migrations (creates shared schema):

python manage.py migrate_schemas --shared

5. Creating Public Tenant

python manage.py shell
from tenants.models import Tenant, Domain

# Create tenant
tenant = Tenant.objects.create(
    schema_name='public',
    name='Website',
    subdomain='',
    is_active=True
)

# Create domain mapping
Domain.objects.create(
    domain='localhost',
    tenant=tenant,
    is_primary=True
)

# Create User
python manage.py create_platform_user admin admin123  --is_platform_admin

6. Start Development Server

python manage.py runserver

Access the application:

Database Migrations

For shared schema:

python manage.py makemigrations
python manage.py migrate_schemas --shared

About

Comprehensive Information Management System (IMS) made with Django and Django Rest Framework.

Topics

Resources

Contributing

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages