mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
detect if AdminHandler can be imported. close #333
This commit is contained in:
parent
0d58056132
commit
da11bce9a7
@ -23,7 +23,6 @@ try:
|
|||||||
django14 = True
|
django14 = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
from django.core.servers.basehttp import AdminMediaHandler
|
|
||||||
django14 = False
|
django14 = False
|
||||||
|
|
||||||
from gunicorn import util
|
from gunicorn import util
|
||||||
@ -109,7 +108,9 @@ def reload_django_settings():
|
|||||||
|
|
||||||
def make_command_wsgi_application(admin_mediapath):
|
def make_command_wsgi_application(admin_mediapath):
|
||||||
reload_django_settings()
|
reload_django_settings()
|
||||||
if django14:
|
|
||||||
return make_wsgi_application()
|
|
||||||
|
|
||||||
return AdminMediaHandler(make_wsgi_application(), admin_mediapath)
|
try:
|
||||||
|
from django.core.servers.basehttp import AdminMediaHandler
|
||||||
|
return AdminMediaHandler(make_wsgi_application(), admin_mediapath)
|
||||||
|
except ImportError:
|
||||||
|
return make_wsgi_application()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user