Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use system django #43

Closed
summerisgone opened this issue Jan 6, 2012 · 8 comments
Closed

Use system django #43

summerisgone opened this issue Jan 6, 2012 · 8 comments

Comments

@summerisgone
Copy link

Hi! Maybe I miss some buildout magic, but I didn't find a way to use Django system installation.
That would be nice option for some deployment strategies.

@rvanlaar
Copy link
Owner

rvanlaar commented Jan 6, 2012

Hi,

Which version of django recipe are you using?
There is no option for that.
Since 0.99 it uses the system installation if you have that.

I'm not sure what happens when in buildout one would specify a django version and the system version
doesn't match.

@summerisgone
Copy link
Author

Hi!

I'm using latest djangorecipe, 1.2.5. Here's the files:

[buildout]
parts = django
versions = versions

[versions]
djangorecipe = 1.1.2
django = 1.2.5

[django]
recipe = djangorecipe
project = mysite
settings = production

and generated django script:

#!/usr/bin/python

import sys
sys.path[0:0] = [
  '/home/ivan/.buildout/eggs/djangorecipe-1.1.2-py2.7.egg',
  '/home/ivan/.buildout/eggs/Django-1.2.5-py2.7.egg',
  '/home/ivan/.buildout/eggs/zc.recipe.egg-1.2.2-py2.7.egg',
  '/usr/lib/python2.7/dist-packages',
  '/home/ivan/projects/rnd/bdttest/parts/django',
  '/home/ivan/projects/rnd/bdttest',
  ]

import djangorecipe.manage

if __name__ == '__main__':
    djangorecipe.manage.main('mysite.production')

As you can see, PYTHONPATH contains path to Django installed in eggs, not system one. Any help?

@rvanlaar
Copy link
Owner

rvanlaar commented Jan 6, 2012

On 01/06/2012 04:40 PM, Ivan Gromov wrote:

Hi!

I'm using latest djangorecipe, 1.2.5. Here's the files:

[buildout]
parts = django
versions = versions

[versions]
djangorecipe = 1.1.2
django = 1.2.5

Drop the django = 1.2.5.
That'll make sure that the system installed django is used.

@summerisgone
Copy link
Author

Unfortunately not. If I drop django = 1.2.5, django script looks like this:

#!/usr/bin/python

import sys
sys.path[0:0] = [
  '/home/ivan/.buildout/eggs/djangorecipe-1.1.2-py2.7.egg',
  '/home/ivan/.buildout/eggs/Django-1.3.1-py2.7.egg',
  '/home/ivan/.buildout/eggs/zc.recipe.egg-1.2.2-py2.7.egg',
  '/usr/lib/python2.7/dist-packages',
  '/home/ivan/projects/rnd/bdttest/parts/django',
  '/home/ivan/projects/rnd/bdttest',
  ]

import djangorecipe.manage

if __name__ == '__main__':
    djangorecipe.manage.main('mysite.production')

Latest stable Django version has been downloaded, despite I have installed one.

@summerisgone
Copy link
Author

I think it is not exactly bug in djangorecipe, but I hope it is common issue and you may help.
Moreover, there is another reason to use system-installed Django. Recently in debian's python-django package were found and fixed some vunerabilities (http://lists.debian.org/debian-security-announce/2011/msg00028.html).
Our system administrator would be happy to correct them as they appears, but we use separate buildout environment for each project, and we have to update each project.

@rvanlaar
Copy link
Owner

rvanlaar commented Jan 6, 2012

I'll look into the matter a bit more. Stay tuned.

Ivan Gromov reply@reply.github.com wrote:

I think it is not exactly bug in djangorecipe, but I hope it is common issue and you may help.
Moreover, there is another reason to use system-installed Django. Recently in debian's python-django package were found and fixed some vunerabilities (http://lists.debian.org/debian-security-announce/2011/msg00028.html).
Our system administrator would be happy to correct them as they appears, but we use separate buildout environment for each project, and we have to update each project.


Reply to this email directly or view it on GitHub:
#43 (comment)

@summerisgone
Copy link
Author

Okay, I figured out a problem. I'm using debian's system buildout 1.4, but include_site_packages option is available only since buildout release 1.5.2. I upgraded to 1.5.2 and made following manipulations:

  1. Upgraded to buildout 1.5.2
  2. In [versions] section deleted django version specification
  3. run buildout in "non-newset" mode, with key -N
$ cat buildout.cfg 
[buildout]
parts = django1
versions = versions

[versions]

[django1]
recipe = djangorecipe
eggs = kwonly

$ buildout -N
Uninstalling django1.
Installing django1.
Generated script '/home/ivan.gromov/projects/rnd/buildout-check/bin/django1'.
django1: Skipping creating of project: project since it exists

$ cat bin/django1 
#!/home/ivan.gromov/projects/rnd/buildout-check/.env/bin/python

import sys
sys.path[0:0] = [
    '/home/ivan.gromov/projects/rnd/buildout-check/eggs/kwonly-1.0.1-py2.6.egg',
    '/home/ivan.gromov/projects/rnd/buildout-check/eggs/djangorecipe-1.1.2-py2.6.egg',
    '/usr/lib/pymodules/python2.6',
    '/home/ivan.gromov/projects/rnd/buildout-check/eggs/zc.recipe.egg-1.3.2-py2.6.egg',
    '/home/ivan.gromov/projects/rnd/buildout-check/.env/lib/python2.6/site-packages',
    '/home/ivan.gromov/projects/rnd/buildout-check/.env/lib/python2.6/site-packages',
    '/home/ivan.gromov/projects/rnd/buildout-check/parts/django1',
    '/home/ivan.gromov/projects/rnd/buildout-check',
    ]


import djangorecipe.manage

if __name__ == '__main__':
    djangorecipe.manage.main('project.development')

I think issue may be closed, my problem is solved.

@rvanlaar
Copy link
Owner

Thanks for taking the time to report this.
In the process of looking at this issue I've found that djangorecipe includes this line,
/home/ivan.gromov/projects/rnd/buildout-check/parts/django1
which isn't used or necessary. That line will be gone with the next release.

Thnx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants