Skip to main content

Overview

The bootstrap-project command creates a new Django SuperApp project by copying a template repository into a target directory. This is the starting point for creating a new SuperApp-based application.

Syntax

django_superapp bootstrap-project [OPTIONS] TARGET_DIRECTORY

Parameters

TARGET_DIRECTORY
string
required
The directory where the new project will be created. The directory name will also be used as the default project name.

Options

--template-repo
string
The GitHub repository URL to use as the project template. Must be a valid GitHub HTTPS or SSH URL.Accepted formats:

How It Works

  1. The command validates the template repository URL format
  2. Uses Copier to copy the template repository
  3. Sets the project_name variable to the basename of the target directory
  4. Creates the project structure in the specified location

Examples

Basic Usage

Create a project using the default template:
django_superapp bootstrap-project my-project
This creates a new project in the my-project directory with project_name set to “my-project”.

Custom Template Repository

Use a custom template repository (HTTPS):
django_superapp bootstrap-project --template-repo https://github.com/myorg/custom-template my-project

Custom Template with SSH

Use SSH authentication for private repositories:
django_superapp bootstrap-project --template-repo [email protected]:myorg/private-template.git my-project

Absolute Path

Create a project in a specific location:
django_superapp bootstrap-project /path/to/my-project

Validation

The command validates the --template-repo option to ensure it’s a valid GitHub URL:
  • Valid HTTPS format: https://github.com/owner/repo
  • Valid SSH format: [email protected]:owner/repo.git
If the URL doesn’t match these patterns, you’ll receive an error:
Error: The repository URL must be a valid GitHub HTTPS or SSH URL.

Template Variables

The command automatically passes the following variables to the template:
  • project_name: Extracted from the basename of the target directory

After Bootstrapping

Once your project is created, you can:
  1. Navigate to the project directory:
    cd my-project
    
  2. Install dependencies (typically):
    pip install -r requirements.txt
    
  3. Add apps to your project:
    cd superapp/apps
    django_superapp bootstrap-app my-app
    

bootstrap-app

Create apps inside your new project

pull-template

Update your project with template changes

Source Reference

Implementation: main.py:29-44

Build docs developers (and LLMs) love