django-commands
contains the following command extensions
for the Django web framework:
db_clear
-- removes all tables from the database,db_backup
-- creates a backup dump file of the database,db_load
-- loads data from a backup dump file to the database,app_db_tables_reset
-- deletes all data related to the given app from the database,cache_clear
-- callsclear_from_cache()
for all objects in given models.
Only app_db_tables_reset
has been tested with Django 1.9, other commands
may or may not work.
Install the package with pip:
$ pip install git+http://github.com/mrts/django-commands.git
and add 'django_commands'
to INSTALLED_APPS
in your Django
project settings file:
INSTALLED_APPS = ( ... 'django_commands', )
Invoke ./manage.py help
to verify that the commands are available
and ./manage.py help commandname
for more specific usage instructions.
The commands have been created for automating remote deployments with Fabric.
See example fabfile and project setup guidelines.
The workflow would be as follows:
add a feature or fix a bug on git branch
devel
deploy to remote staging server:
fab -H user@host:port deploy:stage
when client is happy with the change, merge it to
master
deploy to remote production server:
fab -H user@host:port deploy:live
fetch database content and uploaded files from remote server as needed:
fab -H user@host:port fetch_data:live