mirror of
https://github.com/jazzband/dj-database-url.git
synced 2026-03-16 22:20:24 +00:00
Handling special case of sqlite://:memory:
This commit is contained in:
parent
fc70e019ba
commit
a14743d00b
1 changed files with 11 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue