Skip to content

Commit

Permalink
forgot to return port in dburl2dict
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsw committed Aug 9, 2012
1 parent df9e043 commit 3861897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/db.py
Expand Up @@ -1136,7 +1136,7 @@ def dburl2dict(url):
Takes a URL to a database and parses it into an equivalent dictionary.
>>> dburl2dict('postgres://james:day@serverfarm.example.net:5432/mygreatdb')
{'user': 'james', 'host': 'serverfarm.example.net', 'db': 'mygreatdb', 'pw': 'day', 'dbn': 'postgres'}
{'host': 'serverfarm.example.net', 'pw': 'day', 'dbn': 'postgres', 'db': 'mygreatdb', 'port': '5432', 'user': 'james'}
"""
dbn, rest = url.split('://', 1)
Expand All @@ -1145,7 +1145,7 @@ def dburl2dict(url):
host, rest = rest.split(':', 1)
port, rest = rest.split('/', 1)
db = rest
return dict(dbn=dbn, user=user, pw=pw, db=db, host=host)
return dict(dbn=dbn, user=user, pw=pw, host=host, port=port, db=db)

_databases = {}
def database(dburl=None, **params):
Expand Down

0 comments on commit 3861897

Please sign in to comment.