Manage Django sites
salt.modules.djangomod.
collectstatic
(settings_module, bin_env=None, no_post_process=False, ignore=None, dry_run=False, clear=False, link=False, no_default_ignore=False, pythonpath=None, env=None, runas=None)¶Collect static files from each of your applications into a single location that can easily be served in production.
CLI Example:
salt '*' django.collectstatic <settings_module>
salt.modules.djangomod.
command
(settings_module, command, bin_env=None, pythonpath=None, env=None, runas=None, *args, **kwargs)¶Run arbitrary django management command
CLI Example:
salt '*' django.command <settings_module> <command>
salt.modules.djangomod.
createsuperuser
(settings_module, username, email, bin_env=None, database=None, pythonpath=None, env=None, runas=None)¶Create a super user for the database.
This function defaults to use the --noinput
flag which prevents the
creation of a password for the superuser.
CLI Example:
salt '*' django.createsuperuser <settings_module> user user@example.com
salt.modules.djangomod.
loaddata
(settings_module, fixtures, bin_env=None, database=None, pythonpath=None, env=None)¶Load fixture data
CLI Example:
salt '*' django.loaddata <settings_module> <comma delimited list of fixtures>
salt.modules.djangomod.
migrate
(settings_module, app_label=None, migration_name=None, bin_env=None, database=None, pythonpath=None, env=None, noinput=True, runas=None)¶Run migrate
Execute the Django-Admin migrate command (requires Django 1.7 or higher).
New in version 3000.
/usr/bin/pip-2.7
or /usr/bin/pip-2.6
. If a directory path is
specified, it is assumed to be a virtualenv.A list of environment variables to be set prior to execution.
Example:
module.run:
- name: django.migrate
- settings_module: my_django_app.settings
- env:
- DATABASE_USER: 'mydbuser'
CLI Example:
salt '*' django.migrate <settings_module>
salt '*' django.migrate <settings_module> <app_label>
salt '*' django.migrate <settings_module> <app_label> <migration_name>
salt.modules.djangomod.
syncdb
(settings_module, bin_env=None, migrate=False, database=None, pythonpath=None, env=None, noinput=True, runas=None)¶Run syncdb
Execute the Django-Admin syncdb command, if South is available on the
minion the migrate
option can be passed as True
calling the
migrations to run after the syncdb completes
NOTE: The syncdb command was deprecated in Django 1.7 and removed in Django 1.9. For Django versions 1.9 or higher use the migrate command instead.
CLI Example:
salt '*' django.syncdb <settings_module>
Docs for previous releases are available on readthedocs.org.
Latest Salt release: latest_release