views:

78

answers:

1
+3  Q: 

Django buildout

Hello,

I'm starting to play around with using buildout for Django. I'd like to use buildout as the main installation method for deploying projects and applications. In this context is it the best that each application contains a buildout, as well as the project? At what level should you apply the buildout?

Thanks,

Todd

+1  A: 

The way I usually set it up is like this:

buildout_dir/
  + bootstrap.py
  + buildout.cfg
  + ...
  + <project_name>/
      + settings.py
      + templates/
      + media/
      + ...  

Since the buildout is (in my case) often tied to a single project anyway, I'll just store the django project directly inside the buildout. By the way: I'm using djangorecipe in my buildout configuration.

The applications I write are simple eggs and have this kind of layout:

django-<app_name>/
  + setup.py
  + <app_name>/
      + __init__.py
      + models.py
      + ...

But I've also seen apps that are a self contained buildout. Jacob Kaplan-Moss even wrote an article about it.

Mark van Lent
Hey thanks, I did not know about the video. It goes right on my must see list.Thanks for some clarity. It is you last line that I was getting hung up on, whether the apps should be eggs or buildout in themselves. But I think I'll be going the egg way.
Todd Matsumoto
Wow, a bit slow on the up take, but it is a little unfortunate that the djangorecipe's option to point to an existing Django project is called projectegg. It took me ages to figure out I just need to literally stick the Django project inside the buildout directory (but then again that's what the answer says). Instead I was trying to figure out how to download the egg into the buildout directory.
Todd Matsumoto