def syncdb(): """ Perform 'syncdb' action for a Django project. """ require("virtualenv_path", "project_path", "sudo_user") utils.django_manage_run( env.virtualenv_path, env.project_path, "syncdb", env.sudo_user, )
def migrate_app_db(app=None, version=None, args=None): require("virtualenv_path", "project_path", "sudo_user") if app: if args: command = ' '.join(['migrate', app, version, args]) else: command = ' '.join(['migrate', app, version]) else: command = "migrate" print command utils.django_manage_run( env.virtualenv_path, env.project_path, command, env.sudo_user, )
def create_superuser(username=None, email=None): """ Create a django superuser """ require("virtualenv_path", "project_path", "sudo_user") cmd = "createsuperuser" if username: cmd = "%s --username=%s" % (cmd, username) if email: cmd = "%s --email=%s" % (cmd, email) utils.django_manage_run( env.virtualenv_path, env.project_path, cmd, env.sudo_user, interactive=True, )