rvanlaar/djangorecipe — Issue #38: sys.path order incorrect on Windows
Author: rvanlaar
Created: 2011-12-27 21:40:45+00:00
State: open
Labels: In Progress, Undecided

I have Django 1.1 installed in Windows. I am using buildout to create a Django installation using Django 1.2.

The generated sys.path in django.wsgi-script.py (and the other scripts) has this:

'c:\\python26\\lib\\site-packages',
'c:\\home\\dhat\\webapps\\portal-1.0\\myproject\\parts\\django',

which makes the new installation use the system Django, not the buildout version needed.
If I reorder those 2 lines it works correctly.

Here's my buildout.cfg:

[buildout]
parts = python django django-patches css dojo
develop = .
eggs = django-notify
dojango
django-maintenancemode
xlrd
xlwt
titlecase
portal_python = 2.6
portal_django = 1.2
dojango_version = dojango-0.4.6-py${buildout:portal_python}
dojo_version = 1.4.2
download-cache = ${buildout:directory}\..\download-cache

[python]
recipe = zc.recipe.egg
interpreter = python
eggs = ${buildout:eggs}

[django]
recipe = djangorecipe
version = ${buildout:portal_django}
project = myproject
projectegg = myproject
settings = settings
wsgi = true
#wsgilog = ${buildout:directory}\var\rp.log
extra-paths = ${buildout:directory}\..
${buildout:directory}\portal
eggs = ${buildout:eggs}
test = portal
events

[django-patches]
# fix for Django ticket 11797
# support Dojo 1.4 in Dojango
recipe = iw.recipe.cmd
on_install = true
on_update = true
cmds =
copy ${buildout:directory}\patches\1.2\client.py ${buildout:directory}\parts\django\django\test
copy ${buildout:directory}\patches\dojango\conf\settings.py ${buildout:directory}\eggs\dojango-0.4.6-py2.6.egg\dojango\conf

[css]
recipe = iw.recipe.cmd
on_install = true
on_update = true
cmds =
mkdir ${buildout:directory}\..\var
mkdir ${buildout:directory}\var
mkdir ${buildout:directory}\var\django_cache
mkdir ${buildout:directory}\var\django_sessions
mkdir \home\dhat\portal\rp
mkdir \home\dhat\portal\rp\teacher
mkdir \home\dhat\portal\admin
xcopy ${buildout:directory}\rp\* \home\dhat\portal\rp /E /D /Y
copy ${buildout:directory}\config\${buildout:portal}\settings_local.py ${buildout:directory}
copy ${buildout:directory}\bin\django.wsgi-script.py ${buildout:directory}\..\myproject.wsgi

[dojo]
recipe = hexagonit.recipe.download
strip-top-level-dir = true
destination = ${buildout:directory}/eggs/${buildout:dojango_version}.egg/dojango/dojo-media/src/${buildout:dojo_version}
url = http://download.dojotoolkit.org/release-${buildout:dojo_version}/dojo-release-${buildout:dojo_version}-src.tar.gz