0

I'm using django-lfs that i installed it using buildout. Now i need to install some other packages to my development environment.

My question is: What is the best way to install other packages (not system wide) in this kind of environment.
Say i want to install django-debug-toolbar only on my dev environment, but not in production.

I'm a user of virtualenv and pip

My project structure

myproject/
  README.txt  
  bootstrap.py  
  develop-eggs/  
  eggs/         
  misc/   
  scripts/
  bin/        
  buildout.cfg  
  dlcache/       
  lfs_project/  
  parts/  
  setup.cfg
Ivan Pereira
  • 2,149
  • 3
  • 24
  • 32

1 Answers1

2

You add the packages to your buildout.cfg. Presumably there is a eggs = entry in that file, either at the global level (in the [buildout] section) or at the individual recipe level.

Adding extra lines is easy, it should end up looking something like this:

eggs = 
    django-lfs
    django-debug-toolbar

The egg names are white-space separated, new lines that are indented count as part of the initial line that is not (standard ConfigParser format).

To differentiate between production and development configurations, simply create separate buildout configurations; I always use a development.cfg and a production.cfg (and staging.cfg, individual cluster machine .cfgs, etc). Buildout configurations can include and override other configurations, so your development.cfg could simply include production.cfg and add eggs and/or alter settings.

See the buildout website for more information. If you want a complex example, look at the Jarn Plone bootstrap buildout; it uses separate production.cfg and development.cfg setups.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • if you need to add some new package, it will only install that package? – Ivan Pereira Apr 10 '12 at 11:13
  • If you update your buildout to add one new egg, running buildout again will add that egg to the local egg directory. The previously installed eggs will be left alone; those are already present after all. These eggs are not installed in the global site packages. – Martijn Pieters Apr 10 '12 at 15:56