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 manage.py truncate --apps myapp --models model1 model2

Installation

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 settings.py file:

    INSTALLED_APPS = [
      ...
      'django_truncate',
    ]
  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 manage.py truncate --apps appone apptwo
  2. If you want you can truncate a specific table(s) in an app using –models:

    python manage.py 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 manage.py truncate -h

License

This project is under the BSD License.

Project details


Release history Release notifications | RSS feed

This version

0.1

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 details)

Uploaded Source

File details

Details for the file django-truncate-0.1.tar.gz.

File metadata

  • Download URL: django-truncate-0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-truncate-0.1.tar.gz
Algorithm Hash digest
SHA256 e6b153145ee898c792bc460031727ddc3518bc7594a58c8935dc4d45c46f06b5
MD5 1b6f9fb1fefb853cafff0005ada2f2b3
BLAKE2b-256 2156451a87bc8ee084c6600cce91d334cae642c5da2d067b944eb54f816d1f1b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page