Skip to main content

A simple Django app to help developers truncate specific models.

Project description

Django-Truncate is a simple library that will add the ability to empty any given model in any app within your django project, in a more SQL related words it will TRUNCATE the TABLE with a simple command:

python truncate --apps myapp --models model1 model2


After you move to your django project main directory follow these simple steps

  1. In your terminal/command line run the following command:

    pip install django-truncate
  2. Add “django-truncate” to your INSTALLED_APPS in the file:

  3. And that’s it! you’re now ready to use it.

Usage & Options

  1. You can truncate all of the tables in one app or multiple apps using –apps:

    python truncate --apps appone apptwo
  2. If you want you can truncate a specific table(s) in an app using –models:

    python truncate --apps appone --models Model3

    Note if you don’t write the name of the app the truncate will stop and you’ll see an error message in the terminal

Remember you can always see the instructions by running:

python truncate -h


This project is under the BSD License.

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-truncate-0.1.tar.gz (4.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page