mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
just load environ when we load the app
This commit is contained in:
parent
76a0d7ae83
commit
a942f6a06c
@ -43,9 +43,6 @@ class DjangoApplication(Application):
|
|||||||
sys.path.insert(0, self.project_path)
|
sys.path.insert(0, self.project_path)
|
||||||
sys.path.append(os.path.join(self.project_path, os.pardir))
|
sys.path.append(os.path.join(self.project_path, os.pardir))
|
||||||
|
|
||||||
# setup envoron
|
|
||||||
self.setup_environ()
|
|
||||||
|
|
||||||
def setup_environ(self):
|
def setup_environ(self):
|
||||||
from django.core.management import setup_environ
|
from django.core.management import setup_environ
|
||||||
try:
|
try:
|
||||||
@ -75,6 +72,8 @@ class DjangoApplication(Application):
|
|||||||
from django.conf import ENVIRONMENT_VARIABLE
|
from django.conf import ENVIRONMENT_VARIABLE
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
os.environ[ENVIRONMENT_VARIABLE] = self.settings_modname
|
os.environ[ENVIRONMENT_VARIABLE] = self.settings_modname
|
||||||
|
# setup envoron
|
||||||
|
self.setup_environ()
|
||||||
return WSGIHandler()
|
return WSGIHandler()
|
||||||
|
|
||||||
class DjangoApplicationCommand(Application):
|
class DjangoApplicationCommand(Application):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user