From d06380d1f0143ce50a6bafcd2b229b203390bbe9 Mon Sep 17 00:00:00 2001 From: benoitc Date: Tue, 6 Nov 2012 05:51:57 +0100 Subject: [PATCH] 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. --- gunicorn/app/djangoapp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/app/djangoapp.py b/gunicorn/app/djangoapp.py index 6eb5d574..7fe44cff 100644 --- a/gunicorn/app/djangoapp.py +++ b/gunicorn/app/djangoapp.py @@ -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.