From fc70e019baf339dacfaf613824c8b4b9334a0156 Mon Sep 17 00:00:00 2001 From: carlio Date: Sat, 5 Jan 2013 11:22:45 +0100 Subject: [PATCH] Empty sqlite path will now use a :memory: database --- dj_database_url.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dj_database_url.py b/dj_database_url.py index 7805aa0..58d7ed6 100644 --- a/dj_database_url.py +++ b/dj_database_url.py @@ -53,6 +53,11 @@ def parse(url): path = url.path[1:] path = path.split('?', 2)[0] + # if we are using sqlite and we have no path, then assume we + # want an in-memory database (this is the behaviour of sqlalchemy) + if url.scheme == 'sqlite' and path == '': + path = ':memory:' + # Update with environment configuration. config.update({ 'NAME': path,