Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying a Django Opensource Application with dependencies

I'm working with a friend on a web application we'd like to distribute and we're working in Django.

I'd like to make sure deployment is as easy as possible for potential users. It seems that Django uses shared installed libraries alot and I'd like for folks to just need to download our latest version, unzip, edit a config file or two and get started, like wordpress etc.

I'm used to the ruby on rails style deployment where you pistonize your gems and plugins into a vendor directory and that's all you need to rely on.

What's the analogous django way to deploy an application with all of the dependencies bundled? I'd prefer not to have to use something like easy_install to pull down dependencies after install.

This Python Stack Overflow Answer seems like it is on the right track, but is there a django specific way to go? Is this a solved problem?

like image 310
MattK Avatar asked Nov 04 '09 02:11

MattK


2 Answers

Your best bet here is to make use of pip. pip is a utility for installing python packages. it allows you to create requirements files that list dependencies for a project. pip is quite common and widely used by the Django community, and I would highly recommend using it.

As T. Stone mentioned Pinax, a Django-based project has many dependencies and they make use of pip requirements files quite sucessfully.

like image 166
richleland Avatar answered Sep 28 '22 05:09

richleland


This is one of the big limitations with the Django "Reusable app". On the "This Week in Django" podcast a week or two ago they were talking about this exact problem. It seems the consensus, and I agree, is that there really isn't a solution.

If you look at Pynax, which is probably the largest distributed Django project, you'll see they are bundling the apps with the whole system.

Python itself has a few package distributions. I know ActiveState is working on starting up another. But even then not all of the django apps are packaged. Many are only found in bitbucket, github, or google source. And even then, to get a copy of all those requires one to have mercurial, git, and svn installed. (blah @ that)

You basically have 2 options here:

  1. Include a copy of every dependency with your source
  2. Include documentation for how the users install a given dependency

It's a sad list, I know. It sucks actually, especially after using the ruby gem system, but at the moment I'm not sure what better you're going to find.

If it's of any interest, I wrote a short blog post about keeping dependencies in your project's folder (or in SVN) and then adding that path to Python's search path at the start of django. ( Managing Django Dependencies via SVN ) It screws up Komodo Edit's intellisense, but it does make things easier otherwise.

like image 40
T. Stone Avatar answered Sep 28 '22 07:09

T. Stone