PostgresqlDatabase unable to connect with any database
in case anyone else stumbles upon this combination (Heroku Postgres with peewee), the trick seems to be to parse the Heroku-provided URL first, and then provide the parsed components to the PostgresqlDatabase constructor. It looks like this:

```python
url = urlparse.urlparse(os.environ["DATABASE_URL"])
db = PostgresqlDatabase(database=url.path[1:], user=url.username, password=url.password, host=url.hostname, port=url.port)
```

Source:
https://swifthorseman.com/2015/06/18/deploying-a-flask-app-with-peewee-to-heroku/ Thanks @gregsadetsky 
I have a project with a virtualenv running CPython 2.7 and a pip installed peewee. When I do:

```
psql_db = PostgresqlDatabase('postgres://me@localhost/whatever')                                                                    
psql_db.connect()
```

on  a pre-existing database that has schema, tables, and rows of data, I get the following stacktrace:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/dwatson/Environments/sensor_data/lib/python2.7/site-packages/peewee.py", line 3296, in connect
    self.initialize_connection(self.__local.conn)
  File "/Users/dwatson/Environments/sensor_data/lib/python2.7/site-packages/peewee.py", line 3212, in __exit__
    reraise(new_type, new_type(*exc_args), traceback)
  File "/Users/dwatson/Environments/sensor_data/lib/python2.7/site-packages/peewee.py", line 3294, in connect
    **self.connect_kwargs)
  File "/Users/dwatson/Environments/sensor_data/lib/python2.7/site-packages/peewee.py", line 3632, in _connect
    conn = psycopg2.connect(database=database, **kwargs)
  File "/Users/dwatson/Environments/sensor_data/lib/python2.7/site-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
peewee.OperationalError: FATAL:  database "postgres://me@localhost/whatever" does not exist
```

In the same virtualenv:

```
from postgres import Postgres
db = Postgres("postgres://me@localhost/whatever")
db.all('select * from some_table;')
```

And I get several thousand rows of data. 

I've tried all variants of Postgresql URI I could think of including password, port, etc. None of them will connect.

I am using Heroku Postgres.app on Mac OS X 10.10 and I can telnet to localhost:5432 and get the postgres interface.
