Ejemplo n.º 1
0
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,
    )
Ejemplo n.º 2
0
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,
    )
Ejemplo n.º 3
0
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,
    )
Ejemplo n.º 4
0
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,
    )
Ejemplo n.º 5
0
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,
    )
Ejemplo n.º 6
0
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,
    )