Fabric commands

TracPro uses the Caktus project template. See the server documentation to learn more about server architecture and provisioning.

Before using fabric commands, follow all of the steps in the developer setup docs to ensure that you have all of the required credentials.

You can get a full list of Fabric commands by running fab --list, or read through the source at fabfile.py.

Copying data for local development

To copy the database and media files from a remote server to your local development environment:

fab [production|staging] reset_local_db

NOTE: Migrations must be run (django-admin migrate) if the local branch has migrations that have not yet been run on the remote server.

Copying production data to staging

To copy the production database to staging:

fab prod_db_to_staging

NOTES: Migrations must run (fab staging manage_run:"migrate") if the branch that is deployed on staging has new migrations that have not been run on production.

Running commands on the server

To run a management command on a remote server:

fab [production|staging] manage_run:"command_name -arg --option param1 param2"

Use the manage_shell alias to run a Python shell on a remote server:

fab [production|staging] manage_shell