[Distutils] [buildout] import develop eggs

mustapha mustapha at headnet.dk
Mon Jun 16 08:44:11 CEST 2008


You have to say to buildout that you want to use myapp in the django 
part. Add myapp to the eggs of the [django] part or add it to the 
buildout's eggs option because you are including ${buildout:eggs} in the 
[django]'s eggs. So do:

[buidlout]
eggs =
     psycopg2
     myapp

develop = src/myapp

or:

[django]
eggs =
     ${buildout:eggs}
     myapp



stefan tjarks wrote:
> I'm not sure where to post this, so if it's the wrong list please point
> me to the right one.
> 
> I started using zc.buildout with django and are using djangorecipe[1].
> After running buildout and trying to start django it fails trying to
> import my development module. Here is what I did in more detail.
> 
> My folder structure:
> 
> root/
>   bootstrap.py
>   buildout.cfg
>   src/
>     myapp/
>       setup.py
>       src/
>         ...
> 
> The buildout.cfg:
> 
>   [buildout]
>   parts = django
>   eggs = psycopg2
>   develop = src/myapp
> 
>   [django]
>   recipe = djangorecipe
>   version = trunk
>   django_location = ${buildout:directory}/django_src
>   settings = development
>   eggs = ${buildout:eggs}
>   project = instance
> 
> Running bootstrap.py and bin/buildout works fine and gives me a
> develop-eggs directory with an .egg-link file as well as a bin/django file.
> 
> After inserting 'myapp' into djangos settings file I tried to start
> django with 'bin/django runserver' and it failed with
> 
>   ImportError: No module named myapp
> 
> The bin/django file is basically a wrapper, that sets the python path to
> all eggs and the project root directory.
> 
>   #!/home/dev/python2.5/bin/python
> 
>   import sys
>   sys.path[0:0] = [
>   '/home/dev/eggs/psycopg2-2.0.7-py2.5-linux-ppc.egg',
>   '/home/dev/eggs/djangorecipe-0.8-py2.5.egg',
>   '/home/dev/eggs/zc.recipe.egg-1.0.0-py2.5.egg',
>   '/home/dev/eggs/zc.buildout-1.0.6-py2.5.egg',
>   '/home/dev/eggs/setuptools-0.6c8-py2.5.egg',
>   '/home/dev/parts/django',
>   '/home/dev',
>   ]
> 
>   import djangorecipe.manage
> 
>   if __name__ == '__main__':
>       djangorecipe.manage.main('instance.development')
> 
> I don't see what I have missed. I do see that the develop-eggs directory
> is nowhere mentioned in the generated files, but thought that setuptools
> would take care of that and made the dev eggs importable.
> 
> Regards
> -stj
> 
> [1] https://launchpad.net/djangorecipe

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG at python.org
http://mail.python.org/mailman/listinfo/distutils-sig




More information about the Distutils-SIG mailing list