Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

forgot to return port in dburl2dict

  • Loading branch information...
commit 386189731830d67666803fe988db59023f6391ea 1 parent df9e043
Aaron Swartz aaronsw authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 web/db.py
4 web/db.py
View
@@ -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)
@@ -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):
Please sign in to comment.
Something went wrong with that request. Please try again.