mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Fix up for ./manage.py run_gunicorn
This commit is contained in:
parent
a28c484d5d
commit
ac9f38de53
2
.gitignore
vendored
2
.gitignore
vendored
@ -14,3 +14,5 @@ gunicorn.egg-info
|
|||||||
nohup.out
|
nohup.out
|
||||||
.coverage
|
.coverage
|
||||||
doc/.sass-cache
|
doc/.sass-cache
|
||||||
|
examples/frameworks/pylonstest/PasteScript*
|
||||||
|
examples/frameworks/pylonstest/pylonstest.egg-info/
|
||||||
|
|||||||
@ -50,17 +50,20 @@ class DjangoApplication(Application):
|
|||||||
class DjangoApplicationCommand(Application):
|
class DjangoApplicationCommand(Application):
|
||||||
|
|
||||||
def __init__(self, options, admin_media_path):
|
def __init__(self, options, admin_media_path):
|
||||||
self.cfg = Config()
|
self.config_file = options.get("config") or ""
|
||||||
|
self.options = options
|
||||||
|
self.admin_media_path = admin_media_path
|
||||||
self.callable = None
|
self.callable = None
|
||||||
|
self.load_config()
|
||||||
|
|
||||||
# Load up the config file if its found.
|
def load_config(self):
|
||||||
|
self.cfg = Config()
|
||||||
config_file = options.get("config") or ""
|
|
||||||
if config_file and os.path.exists(config_file):
|
if self.config_file and os.path.exists(self.config_file):
|
||||||
cfg = {
|
cfg = {
|
||||||
"__builtins__": __builtins__,
|
"__builtins__": __builtins__,
|
||||||
"__name__": "__config__",
|
"__name__": "__config__",
|
||||||
"__file__": config_file,
|
"__file__": self.config_file,
|
||||||
"__doc__": None,
|
"__doc__": None,
|
||||||
"__package__": None
|
"__package__": None
|
||||||
}
|
}
|
||||||
@ -81,12 +84,10 @@ class DjangoApplicationCommand(Application):
|
|||||||
sys.stderr.write("Invalid value for %s: %s\n\n" % (k, v))
|
sys.stderr.write("Invalid value for %s: %s\n\n" % (k, v))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
for k, v in list(options.items()):
|
for k, v in list(self.options.items()):
|
||||||
if k.lower() in self.cfg.settings and v is not None:
|
if k.lower() in self.cfg.settings and v is not None:
|
||||||
self.cfg.set(k.lower(), v)
|
self.cfg.set(k.lower(), v)
|
||||||
|
|
||||||
self.admin_media_path = admin_media_path
|
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
try:
|
try:
|
||||||
return AdminMediaHandler(WSGIHandler(), self.admin_media_path)
|
return AdminMediaHandler(WSGIHandler(), self.admin_media_path)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user