mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #221 don't override sys.path if project_path is already in.
This commit is contained in:
parent
0f53a83f49
commit
1a796ebbc6
@ -44,9 +44,10 @@ class DjangoApplication(Application):
|
||||
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
|
||||
@ -132,9 +133,10 @@ class DjangoApplicationCommand(DjangoApplication):
|
||||
|
||||
|
||||
# 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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user