ANSIBLE.DJANGO_MANAGE(3)

NAME
django_manage - Manages a Django application.

DESCRIPTION

Manages a Django application using the manage.py application frontend to django-admin. With the virtualenv parameter, all management commands will be executed by the given virtualenv installation.

OPTIONS

app_path
    The path to the root of the Django application where manage.py lives.(required)

apps
    A list of space-delimited apps to target. Used by the 'test' command.

cache_table
    The name of the table used for database-backed caching. Used by the 'createcachetable' command.

command
    The name of the Django management command to run. Allowed commands are cleanup, createcachetable, flush, loaddata, syncdb, test, validate. Choices: cleanup,flush,loaddata,runfcgi,syncdb,test,validate.(required)

database
    The database to target. Used by the 'createcachetable', 'flush', 'loaddata', and 'syncdb' commands.

failfast
    Fail the command immediately if a test fails. Used by the 'test' command. Choices: yes,no. (default: no)

fixtures
    A space-delimited list of fixture file names to load in the database. Required by the 'loaddata' command.

pythonpath
    A directory to add to the Python path. Typically used to include the settings module if it is located external to the application directory.

settings
    The Python path to the application's settings module, such as 'myapp.settings'.

virtualenv
    An optional path to a virtualenv installation to use while running the manage application.."

NOTES

http://www.virtualenv.org/, virtualenv must be installed on the remote host if the virtualenv parameter is specified.

This module will create a virtualenv if the virtualenv parameter is specified and a virtualenv does not already exist at the given location.

This module assumes English error messages for the 'createcachetable' command to detect table existence, unfortunately.
# Run cleanup on the application installed in '$django_dir'.
django_manage: command=cleanup app_path=$django_dir
# Load the $initial_data fixture into the application
django_manage: command=loaddata app_path=$django_dir fixtures=$initial_data
#Run syncdb on the application
django_manage: >
    command=syncdb
    app_path=$django_dir
    settings=$settings_app_name
    pythonpath=$settings_dir
    virtualenv=$virtualenv_dir
    database=$mydb
#Run the SmokeTest test case from the main app. Useful for testing deploys.
django_manage command=test app_path=django_dir apps=main.SmokeTest

AUTHOR
Scott Anderson

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#django-manage