Skip to content

Commit

Permalink
fix issue benoitc#221 don't override sys.path if project_path is alre…
Browse files Browse the repository at this point in the history
…ady in.
  • Loading branch information
benoitc committed Jul 6, 2011
1 parent 0f53a83 commit 1a796eb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions gunicorn/app/djangoapp.py
Expand Up @@ -44,9 +44,10 @@ def init(self, parser, opts, args):
self.cfg.set("default_proc_name", self.settings_modname)

# add the project path to sys.path
sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir)))
if not self.project_path in sys.path:
sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir)))

def setup_environ(self):
from django.core.management import setup_environ
Expand Down Expand Up @@ -132,9 +133,10 @@ def init(self):


# add the project path to sys.path
sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir)))
if not self.project_path in sys.path:
sys.path.insert(0, self.project_path)
sys.path.append(os.path.normpath(os.path.join(self.project_path,
os.pardir)))

def load_config(self):
self.cfg = Config()
Expand Down

0 comments on commit 1a796eb

Please sign in to comment.