.. _management:

Management functions/commands
=============================

.. module:: swingers.management
   :synopsis: Swingers base's management functions/commands.

Swingers base's management functions/commands.

.. highlightlang:: html+django

.. function:: add_view_permissions

    Adds a *view_** permission for all *content types*. This function is
    automatically called in a *post_syncdb* hook.


Commands
--------

.. function:: quickdeploy

    Run `manage.py collectstatic --noinput` (if staticfiles_storage is local
    filesystem, add `--link` option). Fix ownership and permissions for
    `media/`, `.`, cronjobs and `settings.STATIC_ROOT`.

.. function:: syncdbmigrate

    Runs `manage.py syncdb --noinput`, `manage.py update_permissions`,
    `manage.py migrate --no-initial-data` and `manage.py migrate`.

.. function:: drop_create_db

    Deletes all tables in the "default" database and then runs
    `manage.py syncdbmigrate`.

.. function:: deploy

    Runs `syncdbmigrate` and `quickinstall`.

.. function:: metrics

    Runs pep8, cloccount and pyflakes.

.. function:: create_db

    Creates and starts a local postgis-enabled postgresql db based on the
    `settings.DATABASES['default']`".
