How can I have multiple Django projects in a single buildout repo?

Asked by Travis Jensen on 2013-03-12

This isn't so much a bug as a question of functionality. I have a project that I would like to break into effectively three sub-projects.

The projects are "shared", "ui" and "events". "shared", as its name implies, contains shared code like db models; "ui" contains the actual web application; and "events" contains processors for various events the rely on the "shared" db models. Because the whole point of "shared" is to share the Django models (and other utility-type code), it needs to be a basic Django application, as does "events" for the same reason.

So the question is, can I set each of them up with its own djangorecipe in some way or do I have to use zc.recipe.egg:custom and basically re-roll the djangorecipe stuff for "shared" and "events" (it seems like "ui" would make the most sense to leave as djangorecipe if I can only have one)?

I've tried a lot of different things, but the core problem I seem to hit is that I can only have one setup.py (afaik!), and so it can only find whichever project I include in that setup.py. I was hoping I could get around the single-setup.py issue by passing environment variables that setup.py looks at to decide which project to actually install, but that has been a bust so far.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Django Recipe Edit question
Assignee:
No assignee Edit question
Solved by:
Travis Jensen
Solved:
2013-03-20
Last query:
2013-03-20
Last reply:
Travis Jensen (travis-jensen) said : #1

To answer my own question: Buildout finds the setup.py files using the develop attribute of the buildout key, so instead of:

[buildout]
develop = .

make it:

[buildout]
develop = path/to/first path/to/second

Naturally, the packages and package_dir parameters of the setup() call must be updated accordingly.