diff --git a/dj_database_url.py b/dj_database_url.py index 58d7ed6..2bd8e4d 100644 --- a/dj_database_url.py +++ b/dj_database_url.py @@ -45,6 +45,17 @@ def config(env=DEFAULT_ENV, default=None): def parse(url): """Parses a database URL.""" + if url == 'sqlite://:memory:': + # this is a special case, because if we pass this URL into + # urlparse, urlparse will choke trying to interpret "memory" + # as a port number + return { + 'ENGINE': SCHEMES['sqlite'], + 'NAME': ':memory:' + } + # note: no other settings are required for sqlite + + # otherwise parse the url as normal config = {} url = urlparse.urlparse(url)