Skip to content

Installation & Configuration

Let's start from a clean baseline and get a project running with the right defaults. django-mindoff provides a structured foundation for building APIs with predictable scaffolding and consistent runtime conventions. By following these steps, you'll have a fully configured project ready for development.

Prerequisites

  • Python >=3.12
  • pip
  • git
  • An empty or dedicated project directory

Implementation

1. Install django-mindoff

pip install django-mindoff

The installation exposes the CLI:

django-mindoff --help

2. Initialize a New Project

From your project directory:

django-mindoff init

Heads up!

django-mindoff init sets up a virtual environment, git and installs the framework's compatible dependency set automatically. This includes core packages such as Django, Django REST Framework, Polars, and supporting runtime/testing dependencies required by the scaffold.

For full dependency details, see Architecture Requirements.

This may take a few minutes

django-mindoff init can take some time to complete depending on internet speed and system capabilities.

The command scaffolds a runnable project, including:

  • manage.py -- Django management entry point.
  • mindoff.py -- Local CLI entry point for app/model/API scaffolding tasks.
  • .env -- Environment configuration file generated for local setup.
  • pytest.ini -- Base test runner configuration.
  • README.md -- Project-level readme scaffold.
  • config/ -- Core Django configuration package. Typically includes: settings.py, urls.py, asgi.py, wsgi.py, and responses.csv.
  • apps/ -- Workspace for all domain apps we create with the CLI.
  • templates/ -- Base HTML templates created by the scaffold.

For the full directory tree and architecture-level breakdown, see Management Kit.

3. Configure Core Settings

Open config/settings.py and set core defaults for local development:

DEBUG = True
ALLOWED_HOSTS = []

If queue/background processing is needed, set Redis in .env ( see Queue Mode API for more details.):

REDIS_URL=redis://127.0.0.1:6379/0

Then load it in config/settings.py (if not already configured):

REDIS_URL = config("REDIS_URL", default=None)

4. Run Virtual Environment

Before running migrations or starting the server, activate the project's virtual environment.

Windows (Command Prompt):

.venv\Scripts\activate.bat

Windows (PowerShell):

.venv\Scripts\Activate.ps1

macOS/Linux:

source .venv/bin/activate

5. Run the Project

Run initial migrations to prepare your database:

python manage.py makemigrations
python manage.py migrate

Start the server:

python manage.py runserver

If the server starts without configuration errors, setup is complete. Continue to App and Model Setup.

Troubleshooting

  • django-mindoff: command not found
    Install with the same Python interpreter you use for the project environment.
  • ModuleNotFoundError during startup
    Activate your virtual environment, then reinstall dependencies.