From 5b0616ad7d7c3734f1818a56b631a2d254271678 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Mon, 27 Oct 2014 19:03:06 +0000 Subject: bitbake: toaster: skip virtualenv when searching for django apps If we are using a virtualenv in the current search path we end up trying to add modules to the django apps list which do not have the correct load path or are internal to other modules. Fix this by skipping the virtualenv path. [YOCTO #6896] (Bitbake rev: 3f614295d688c33b690f63ff7eb28e6988707919) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastermain/settings.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bitbake/lib/toaster/toastermain/settings.py') diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 8de3b52f34..0974b90525 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py @@ -264,6 +264,10 @@ import os currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): modulename = os.path.basename(t[0]) + #if we have a virtualenv skip it to avoid incorrect imports + if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: + continue + if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: INSTALLED_APPS = INSTALLED_APPS + (modulename,) -- cgit v1.2.3-54-g00ecf