abidibo.net

Posted in "fabric"

Deploy django applications with nginx, uwsgi, virtualenv, south, git and fabric, part 5

deploy django fabric git nginx programming south uwsgi virtualenv

This is the fifth and last part of the django deploy environment, you may find the fourth part here.

In this part we'll see how to automate the deployment using fabric.

What the hell have fabric to do?

Well, fabric have to do all the work for me in the sense that once I've done some changes to my project and pushed them to the bare repository I want to update the production environment with only one command. I'd like also to setup initially the whole environment with only one command.

How does it work?

First of all install it, so with the virtualenv activated:

$ pip install fabric

Done.

Now reading from the official site:

Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting ...

read the full post


Deploy django applications with nginx, uwsgi, virtualenv, south, git and fabric, part 4

deploy django fabric git programming virtualenv

This is the fourth part of the django deploy environment, you may find the third part here.

In this part we'll see how to freeze the project requirements, use versioning and prepare all in order to automate the deployment in production with fabric (which will be the argument of the last post, part 5).

Create a requirements.txt

As said in all previous posts, all the packages used by our project have been installed in a virtualenv which is strictly connected to our project. And if you were asking yourself why this is a convenient way to approach the django developement issue here comes the answer.

Activate the virtualenv, go inside the container folder of your django project and then perform this simple command

$ pip freeze > requirements.txt

This command simply creates a requirements.txt files which contains all the project dependencies, look at the image illustrating the project folder structure in the part 2, you'll see the same file there.

The nice part here is that you may setup an equivalent environment, with all the dependencies ...

read the full post


  • 1

Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!

Featured