skip to navigation
skip to content

dploi-fabric 0.1.31

A collection of fabric tasks

Latest Version: 0.2.1

This is a set of reusable fabric tasks. It uses the new-style task system of fabric >= 1.2


  • Add dploi-fabric to your buildout environment (preferably in development_local.cfg, the servers have no use for it).

  • Create a as normal.

  • Pick and choose the modules and import them in the, e.g.:

    from fabric.decorators import task
    from dploi_fabric.db import pg # if project uses mysql, import "mysql" instead
    from dploi_fabric import supervisor, nginx
    from dploi_fabric import git, utils, buildout, south, django_utils, project
    from dploi_fabric.conf import load_settings
    def dev():
    def stage():
    def live():
    def deploy():
  • in the project root, create a file following this template:

    project_name = 'awesome_new_website'
    settings = {
        'dev': {
            'hosts': [''],
            'autostart': True,
            'path': '/home/awesome_new_website-dev/app/',
            'user': 'awesome_new_website-dev',
            'buildout_cfg': 'server_dev.cfg',
            'repo': '',
            'branch': 'master',
            'backup_dir': '/home/awesome_new_website-dev/tmp/', # Used for mysql/psql dumps
            'db_name': 'awesome_new_website-dev',
            'db_username': 'awesome_new_website-dev',
            'domains': ['', ''],
            'domains_redirect': [
                {'domain': '', 'destination_domain': ''},
            'ssl': True,
            'ssl_key_path': '../config/ssl.key', # This must be uploaded manually, possibly by a task in the future
            'ssl_cert_path': '../config/ssl.crt', # This must be uploaded manually, possibly by a task in the future
            'basic_auth': False,
            'basic_auth_path': '../config/htpasswd', # This must be uploaded manually, possibly by a task in the future

    add settings for stage/live as needed.

  • call bin/fab --list for a list of commands


when using these tasks, all project-specific tasks have to be decorated with the @task decorator from fabric.api.

Configuration file (config.ini)

Remember to add config.ini, example:


/media/ = py_src/project/media/



/static/ = %(static_files)s


The [celery] section has some special configuration parameters:

  • version (default: empty): set the celery version. Other the value 3.1 is recognized and triggers the usage of the celery command instead of the django-celery based celeryd.
  • app (default: project): the module that contains the (see the celery documentation)

Other options


tool = buildout (default)

tool = virtualenv

[celery] (if the section is present, celery is enabled)


base = .

base = project/

base = py_src/project (doesnt work with buildout yet, as it would try to access py_src/project/bin/django)

append_settings = true

append_settings = false


(see above)

/url-path/ = rel-path-filesystem/

[sendfile] /protected/media/ = ../upload/
File Type Py Version Uploaded on Size
dploi-fabric-0.1.31.tar.gz (md5) Source 2014-05-19 19KB