Skip to main content

Common methods to help create fabric deplopment scripts for django

Project description

Common methods to help create fabric deplopment scripts for django

The idea is to allow you to use a fabfile.py that has just the unique things for your specific project, while taking advantage of common functions for version control and django tasks.

You can also move configuration out of the fabfile.py into ini style configuration files.

Installation

sudo easy_install django-fab
sudo easy_install http://git.fabfile.org/cgit.cgi/fabric/snapshot/fabric-0.9b1.tar.gz

git example fabfile.py

from __future__ import with_statement
from fabric.api import *
from fabric.context_managers import *
from django.conf import settings
from djangofab.vcs.git import update_remote, update_local, push, commit, add
from djangofab.decorator import user_settings
from djangofab.util import local as local
from djangofab.django import get_remote_db, put_local_db, change_ownership, touch_wsgi
env.capture_default = False

#use the default section of fab.cfg
@user_settings()
def prod():
    "Production settings"
    env.hosts = ['server1']
    env.path = '%(prod_path)s'
    env.giturl = '%(giturl)s'
    env.site_user = 'owner'
    env.site_group = 'group'

@user_settings()
def dev():
    "Development settings"
    env.hosts = ['server1']
    env.path = '%(dev_path)s'
    env.giturl = '%(giturl)s'
    env.site_user = 'owner'
    env.site_group = 'group'

#use the local section
@user_settings('fab.cfg','local')
def localhost():
    "Local settings"
    env.path = '%(dev_path)s'
    env.giturl = '%(giturl)s'

def deploy():
    "Push local changes and update checkout on the remote host"
    push()
    update_remote() # reset and pull on the remote server
    #remote_export()
    change_ownership()
    touch_wsgi()

Requries fabric>=0.9 http://git.fabfile.org/cgit.cgi/fabric/snapshot/fabric-0.9b1.tar.gz

See fabric docs http://docs.fabfile.org/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-fab-1.0.2.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file django-fab-1.0.2.tar.gz.

File metadata

  • Download URL: django-fab-1.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-fab-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f0dcf96717434b1eb6b830bcb6c53380f2d8b544c4f93ca4d54bed6fe9bfbc27
MD5 5423ab693330670284fc6dee504a7841
BLAKE2b-256 20efeaea8f9f4fe41f7b28a56a4089202659b2ac58d89d8e2f466b6ae5e8e2dc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page