diff --git a/src/drf_yasg/generators.py b/src/drf_yasg/generators.py index 4e203a2d..66c8e97c 100644 --- a/src/drf_yasg/generators.py +++ b/src/drf_yasg/generators.py @@ -195,6 +195,8 @@ def __init__(self, info, version='', url=None, patterns=None, urlconf=None): raise SwaggerGenerationError("`url` must be an absolute HTTP(S) url") if parsed_url.path: logger.warning("path component of api base URL %s is ignored; use FORCE_SCRIPT_NAME instead" % url) + else: + self._gen.url = url @property def url(self):