Skip to main content

Django project templates that support fabric-style deployment (vagrant+ubuntu, webfaction)

Project description

django-fab-templates is set of start templates for Django projects. All of these templates support automated Django project deployment with help of Fabric. Feel free to use them as is or tweak them to fit your needs.

Kudos to:

Please submit bugs and improvements as GitHub issues or send them to dmitry.guyvoronsky@gmail.com.

Quick Start

Here is quick primer on creation of new Django project (mysql+south+html5boilerplate) that supports deployment to vagrant-managed virtual box.

First, install everything:

$ pip install django-fab-templates
$ gem install vagrant
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

Then create new Django project, boot and configure vagrant box:

$ paster create -t vagrant_project my_project
$ cd my_project
$ vagrant up

Finally set up your project on virtual vagrant box and test it:

$ fab vagrant setup
$ curl -I http://localhost:8080/

Features

All project templates have the following in common:

  • Automated deployment with help of Fabric command-line tool is supported

  • Excellent html5 boilerplate template is used as a base for html+css+js

  • SQLite and MySQL are used as default db backends

  • Database scheme and data migrations are managed by South

  • Multiple configurations (development/staging/production) and local setting overrides are supported

The following major fab commands are supported in all projects:

  • Webserver manipulation
    • apache_restart - Restarts apache

    • apache_start - Starts apache

    • apache_stop - Stops apache

    • maintenance_off - Turn maintenance mode off

    • maintenance_on - Turn maintenance mode on

  • Database
    • create_database - Create database and db user

    • drop_database - Create database and db user

    • populate_database - Create initial database scheme and load initial data

    • migrate - Migrate database scheme and data

vagrant_project

This project template simplifies Django project development and testing on vagrant-managed virtual box. It uses 32-bit Ubuntu 10.04.2 LTS (Lucid Lynx) release (codename lucid32). Of course you operating system of your choice, just keep in mind you may need to tweak Chef settings in Vagrantfile.

Hint

Vagrant is an amazing tool for managing virtual machines via a simple to use command line interface. With a simple vagrant up you can be working in a clean environment based on a standard template. You will need to install vagrant, download lucid32 box and boot up vagrant by running:

$ gem install vagrant
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
$ vagrant init
$ vagrant up

Please refer to Getting Started with Vagrant manual for details.

The following fab commands are supported in addition to common ones:

  • General commands
    • setup - Setup a fresh virtualenv, install everything we need

    • destroy_world - Removes everything

Example:

$ paster create -t vagrant_project my_project
$ cd my_project
$ vagrant up
$ fab vagrant setup

Dependencies

django-fab-templates requires the following python packages:

  • setuptools - no comments

  • PasteScript - pluggable command-line frontend, including commands to setup package file layouts

  • Cheetah - a template engine and code generation tool

  • Fabric - command-line automation tool

  • Jinja2 - modern and designer friendly templating language for Python

Installation

From pypi:

$ pip install django-fab-templates

or:

$ easy_install django-fab-templates

or clone from GitHub and install manually:

$ git clone git://github.com/dreamiurg/django-fab-templates.git
$ cd django-fab-templates
$ sudo python setup.py install

Usage

To see list of available project templates:

$ paster create --list-templates

To generate Django project template:

$ paster create -t <template_name> <project_name>

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-templates-0.1.2.tar.gz (297.7 kB view details)

Uploaded Source

Built Distributions

django_fab_templates-0.1.2-py2.7.egg (836.0 kB view details)

Uploaded Source

django_fab_templates-0.1.2-py2.6.egg (836.1 kB view details)

Uploaded Source

File details

Details for the file django-fab-templates-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-fab-templates-0.1.2.tar.gz
Algorithm Hash digest
SHA256 18610a88b0e334e9f7ee6ba4a3c183b3ace688d1fe972acef3b8fb1e493f9a3c
MD5 5e9f9a76a24f025bff0a3b688da7d6a9
BLAKE2b-256 08ab99dba8362b7f13cb193c5263cdf5544ee0549b49a28c1cb398578f58b6ef

See more details on using hashes here.

File details

Details for the file django_fab_templates-0.1.2-py2.7.egg.

File metadata

File hashes

Hashes for django_fab_templates-0.1.2-py2.7.egg
Algorithm Hash digest
SHA256 32a3ee97ef2ac320aae2c763563f903247ba25c7063891001bd19be9d6744779
MD5 87fcedbe1a3cbc3eeee11f9597e59aa0
BLAKE2b-256 f9e3aa4c4c553d88ab2b5ace9cf5ee0ac28f1e8fc886f1c5eeca4a4b28358291

See more details on using hashes here.

File details

Details for the file django_fab_templates-0.1.2-py2.6.egg.

File metadata

File hashes

Hashes for django_fab_templates-0.1.2-py2.6.egg
Algorithm Hash digest
SHA256 15172522555e16ff44325af8aaca263a258dacb1fe02ee821628011338f0f888
MD5 35fe3af522fa65eb0b50b9ea0422b34b
BLAKE2b-256 c47a2c27640c48d627d20ecc899a05bdb8ce5c41ea7f49653ed243558e4992af

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