fix issue #221 don't override sys.path if project_path is already in.

This commit is contained in:
benoitc 2011-07-06 17:40:17 +02:00
parent 0f53a83f49
commit 1a796ebbc6

View File

@ -44,6 +44,7 @@ class DjangoApplication(Application):
self.cfg.set("default_proc_name", self.settings_modname) self.cfg.set("default_proc_name", self.settings_modname)
# add the project path to sys.path # add the project path to sys.path
if not self.project_path in sys.path:
sys.path.insert(0, self.project_path) sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path, sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir))) os.pardir)))
@ -132,6 +133,7 @@ class DjangoApplicationCommand(DjangoApplication):
# add the project path to sys.path # add the project path to sys.path
if not self.project_path in sys.path:
sys.path.insert(0, self.project_path) sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path, sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir))) os.pardir)))