Esempio 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,
    )
Esempio 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,
    )
Esempio 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,
    )
Esempio 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,
    )
Esempio 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,
    )
Esempio 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,
    )