diff --git a/dj_static.py b/dj_static.py index ace9758..ce73fae 100644 --- a/dj_static.py +++ b/dj_static.py @@ -34,12 +34,12 @@ class Cling(WSGIHandler): """WSGI middleware that intercepts calls to the static files directory, as defined by the STATIC_URL setting, and serves those files. """ - def __init__(self, application, base_dir=None, ignore_debug=False): + def __init__(self, application, base_dir=None, base_url=None, ignore_debug=False): self.application = application self.ignore_debug = ignore_debug if not base_dir: base_dir = self.get_base_dir() - self.base_url = urlparse(self.get_base_url()) + self.base_url = urlparse(base_url or self.get_base_url()) self.cling = static.Cling(base_dir) try: