• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 12 years ago
  • Updated about 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deployment tool for Django that automatically generates the configuration to deploy your project to various PaaS providers.

django-deployer

django-deployer is a deployment tool for Django that currently deploys any Django app to the following PaaS providers: Dotcloud, Stackato, OpenShift and Google App Engine. The goal of django-deployer is to minimize the effort to deploy a Django app to any of the popular PaaS providers. It asks a series of questions about your Django project, and then generates a generic deploy.yml file that captures all of your project's requirements. django-deployer then uses this deploy.yml file to translate these requirements into specific configurations for each PaaS.

See the roadmap below for adding support for more providers: Heroku, OpenShift, Elastic Beanstalk and Gondor.

Getting Started

To install django-deployer, use pip to fetch the package from PyPi:

$ pip install django-deployer

Now from your project's root directory run the deployer-init command once, and then run fab setup.

In this example (using paasbakeoff), we are going to tell django-deployer to prepare our project to deploy to Google App Engine.

$ deployer-init
$ fab -f fabfile_deployer.py setup

    We need to ask a few questions before we can deploy your Django app
* What is your Django settings module? [settings]
* Where is your manage.py file? [./manage.py]
* Where is your requirements.txt file? [requirements.txt]
* What version of Python does your app need? [Python2.7]
* What is your STATIC_URL? [/static/]
* What is your MEDIA_URL? [/media/]
* Which provider would you like to deploy to (dotcloud, appengine, stackato, openshift)?
* What's your Google App Engine application ID (see https://appengine.google.com/)?
* What's the full instance ID of your Cloud SQL instance (should be in format "projectid:instanceid" found at https://code.google.com/apis/console/)?  * What's your database name?
* Where is your Google App Engine SDK location? [/usr/local/google_appengine]
* What do you want to set as the admin password?
    Creating a deploy.yml with your app's deploy info...
    Created /Users/nateaune/Dropbox/code/paasbakeoff/deploy.yml

    Just a few more steps before you're ready to deploy your app!

    1. Run this command to create the virtualenv with all the packages and deploy:

            $ fab -f fabfile_deployer.py deploy

    2. Create and sync the db on the Cloud SQL:

            $ sh manage.sh cloudcreatedb
            $ sh manage.sh cloudsyncdb

    3. Everything is set up now, you can run other commands that will execute on your remotely deployed app, such as:

            $ sh manage.sh dbshell

    Done.

Now inspect your project directory and you will see that a file deploy.yml and various config files were created.

Note: if you're going to try different PaaS providers, it's recommended that you make a separate git branch for each one, because when you re-run fab setup it could inadvertently overwrite the config files from the first run.

Upgrading

You will notice that when we ran pip install django-deployer it created a script deployer-init. When you ran this script, it created a fabfile.py in your current directory that imports the tasks module from the django-deployer project.

from django_deployer.tasks import *

This means that you can update the django-deployer package and don't need to regenerate the fabfile.

$ pip install -U django-deployer

Contribute

If you want to develop django-deployer, you can clone it and install it into your project's virtualenv:

$ source bin/activate
(venv)$ git clone git://github.com/natea/django-deployer.git
(venv)$ cd django-deployer
(venv)$ python setup.py develop

Or you can also install an editable source version of it using pip:

$ source bin/activate
(venv)$ pip install -e git+git://github.com/natea/django-deployer.git#django-deployer

Which will clone the git repo into the src directory of your project's virtualenv.

Roadmap

  • Add support for Heroku, OpenShift, Amazon Elastic Beanstalk and Gondor
  • Perform some intelligent code analysis to better guess the settings (see the djangolint project - https://github.com/yumike/djangolint)
  • Write tests!
  • Caching (Redis, Memcache)
  • Celery
  • Email
  • SSL
Bitdeli badge

More Repositories

1

djangostarterkit

Everything you need to get started with Django
Python
28
star
2

Valentunes

Valentunes
Python
14
star
3

Motini

Motini is a web-based tool to easily theme websites with a point-n-click interface.
Python
10
star
4

pickupconnect

App to call those who are important to you
JavaScript
9
star
5

edx-in-a-box

edX-in-a-box is a one-click installer to quickly evaluate edX on your computer
8
star
6

Haitian-Stories

Haitian Stories is a website developed at CrisisCamp Boston to provide a forum for Haitian survivors to tell their story in text, audio or video. It's written in Django.
Python
5
star
7

Pinax_basic_site

The site that is generated if you run "pinax-admin setup_project -b basic <project-name>"
Python
4
star
8

Mezzanine-site

Skeleton project for a Django Mezzanine site
Python
4
star
9

banjo

Banjo
JavaScript
3
star
10

plone4wsgi.buildout

A sample buildout for getting Plone 4 working under mod_wsgi
2
star
11

collective.hostout

zc.buildout deployment and remote control
Python
2
star
12

askbot-example

Example project for AskBot
2
star
13

django-lfc

Lightning Fast CMS based on Django
JavaScript
2
star
14

Miro-Community

The easiest way to create a video website
Python
2
star
15

mediathread_deploy

Testing deploy of MediaThread
Python
1
star
16

eh

My own delicious
JavaScript
1
star
17

getmediathread

Mezzanine-based project for getmediathread.com
Python
1
star
18

hd_django_project_template

Template for Django Projects
Python
1
star
19

MarketplaceDemo

A HubSpot Marketplace app demonstrating basic concepts.
Python
1
star
20

glamkit-demo

Python
1
star
21

Deliverance

my little fork of deliverance
1
star
22

hubtext

Send and receive text messages with Hubspot
Python
1
star
23

lfc_site

Lightning Fast CMS sample site
Python
1
star
24

isotoma.depends.plone4_1

Fork of isotoma.depends.plone4_1 to fix elementtree problem
Python
1
star
25

ourmy

Enlist an "ourmy" of fans to help promote your campaign and post links to Twitter and Facebook
Python
1
star