fix module detection. fix #322

Gunicorn has now the possibility to directly pass the settings env as
argument but it was breaking the old way to do it when giving a path to
the settings file instead.
This commit is contained in:
benoitc 2012-11-06 05:51:57 +01:00
parent bb9ddb4ca9
commit d06380d1f0

View File

@ -71,7 +71,8 @@ class DjangoApplication(Application):
def init(self, parser, opts, args):
if args:
if "." in args[0]:
if ("." in args[0] and not (os.path.isfile(args[0])
or os.path.isdir(args[0]))):
self.cfg.set("django_settings", args[0])
else:
# not settings env set, try to build one.