BOB Docs
APIFeatures

Build App

ClearDatabase

The cleardatabase command removes all data from the connected database.

Usage

python manage.py cleardatabase

⚠️ Warning: This command deletes all data from the database irreversibly. Use with caution.

RemoveMigrations

The removemigrations command deletes all migration files from the project for every app.

Usage

python manage.py removemigrations

This is useful when resetting migrations during significant changes in the data model.

InitializeData

The initializedata command is the designated place to include all data initialization commands for the project. Each app should have its initialization scripts incorporated into this command.

Usage

python manage.py initializedata

Example operations this command could include:

  • Setting up default users.
  • Creating default products or plans.
  • Preloading essential configurations.

BuildApp

The buildapp command automates the entire process of resetting and rebuilding your application. It performs the following steps:

  1. Deletes the database.
  2. Removes migration files.
  3. Creates new migrations.
  4. Applies migrations to the database.
  5. Runs the static files collection script.

Workflow

  • Step 1: Deletes all existing data and database structure.
  • Step 2: Removes all migration files from the project.
  • Step 3: Creates fresh migration files based on the current models.
  • Step 4: Applies these migrations to set up the database schema.
  • Step 5: Collects static files for use in the application.

Usage

python manage.py buildapp

This command is part of the _initializer app and is designed to give you a clean slate for development while maintaining a consistent process.

Benefits

  • Time-Saving: Automates repetitive tasks, allowing you to focus on development.
  • Consistency: Ensures a clean and reliable process for resetting and rebuilding the application.
  • Flexibility: Commands like initializedata can be tailored to the specific needs of your project.

These commands are essential tools for maintaining productivity during the early and highly iterative stages of project development.

On this page