Skip to main content

Compatible with Django 1.8+

For 1.7 compatibility use django-zap==0.0.6

What?

Automates the destruction and recreation of django databases.

Currently only supports local postgres databases. Feel free to add more backends.

Why?

In the early stages of development when your models are heavily in flux, you want to be frequently dropping and recreating the database before re-running django’s syncdb command. This tool uses the database settings in your settings file to prevent you having to duplicate them in some separate database drop/create script.

How?

Just add zap to your installed apps.

A new django management command will appear: zap_and_create_db.

Help is at python manage.py zap_and_create_db --help but the TL;DR is that you can run it without arguments and it’ll drop the user and database, then recreate them. Run it with --migrate and it’ll also run manage.py migrate.

Backends

At the moment the only backend is for linux machines running a local postgresql instance, and authentication is done using the ident rule in the pg_hba.conf, then calling psql as the postgres user.

Feel free to provide more backends or extend the one we have, perhaps to include mac support, or support for other django database engines.

Changelog

0.0.7 (2016-10-07)

Now only compatible with django 1.8+

  • Replaces option_list with add_arguments

0.0.6 (2015-10-29)

  • Adds --droptest argument, which also drops the test database. This feature is aimed at people using –keepdb to speed up their test runs.

0.0.5 (2015-09-16)

  • database argument now passed to backend in support of multiple database setups.

0.0.4 (2015-04-01)

  • #3 Adds a new flag --dropconnections, disabled by default, that tells postgres to terminate all existing sessions before zapping. This is to work around an issue where third party applications open database connections upon app registry installation.

0.0.3 (2015-02-12)

  • Adds OSX detection

  • Adds port option for postgres backend

  • Changes working directory of postgres subprocess command to /tmp

0.0.2 (2014-11-25)

  • Update how args are parsed to allow use from call_command

0.0.1 (2013-09-27)

  • All important fix-the-bladdy-packaging release

0.0.0 (2013-09-27)

  • Initial Release

Release files for django-zap 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-zap 0.0.7
File Size Uploaded
django-zap-0.0.7.zip 10.8 kB Details

Release files / django-zap-0.0.7.zip

Download URL django-zap-0.0.7.zip
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d9ca50babe890a4ad9bbe20de65cb8d380f23a35a1fd85469028258dec27aa76
BLAKE2b-256 checksum
How to use checksums
905113463b961a5abbe52fcd45f28917d91a91a8e3c72eb2bdd874a17ad5f187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page