Overview
Thebootstrap-app command creates a new Django app within an existing SuperApp project by copying a template repository. This command must be run from the superapp/apps directory.
Syntax
Parameters
The directory name for the new app. The directory name will also be used as the app name.
Options
The GitHub repository URL to use as the app template. Must be a valid GitHub HTTPS or SSH URL.Accepted formats:
- HTTPS:
https://github.com/owner/repo - SSH:
[email protected]:owner/repo.git
Unlike
bootstrap-project, this option has no default value. You must specify a template repository.Directory Requirement
How It Works
- Validates that the current directory ends with
superapp/apps - Validates the template repository URL format (if provided)
- Uses Copier to copy the template repository
- Sets the
app_namevariable to the basename of the target directory - Creates the app structure in the specified location
Examples
Basic Usage
First, navigate to the apps directory:Creating Multiple Apps
Create multiple apps in sequence:Using SSH Authentication
For private template repositories:Error Handling
Wrong Directory Error
If you run the command outside ofsuperapp/apps, you’ll see:
Invalid Repository URL
If the repository URL is invalid:- HTTPS:
https://github.com/owner/repo - SSH:
[email protected]:owner/repo.git
Template Variables
The command automatically passes the following variables to the template:app_name: Extracted from the basename of the target directory
Project Structure
After creating an app, your project structure will look like:After Creating an App
Once your app is created:-
Register the app in your Django settings:
-
Create and run migrations if the app includes models:
-
Add URL patterns if needed:
Related Commands
bootstrap-project
Create a new SuperApp project first
pull-template
Update your app with template changes