diff --git a/django_cache_url/__init__.py b/django_cache_url/__init__.py index 2511a66..e67dabe 100644 --- a/django_cache_url/__init__.py +++ b/django_cache_url/__init__.py @@ -93,7 +93,7 @@ def parse(url): config['LOCATION'] = 'unix://' + path elif url.scheme in ('redis', 'hiredis'): - match = re.match(r'.+?(?P\d+)', path) + match = re.match(r'.+?(?P\d+)$', path) if match: db = match.group('db') path = path[:path.rfind('/')]