Does peewee work with Gevent?
Yes it does, You need to set Threadlocals to True

```
# app configuration
DATABASE = {
    'name': 'my_db',
    'engine': 'peewee.PostgresqlDatabase',
    'user': 'postgres',
    'threadlocals': True, # <-- this
}
```

and then just monkey patch the thread module.
 If you're using it with postgresql you need to monkeypatch `psycopg2`:

``` python
from gevent import monkey

from gevent.socket import wait_read, wait_write
try:
    from psycopg2 import extensions
except ImportError:
    extensions = None


def monkeypatch_psycopg2():
    extensions.set_wait_callback(gevent_wait_callback)

def gevent_wait_callback(conn, timeout=None):
    """A wait callback useful to allow gevent to work with Psycopg."""
    while 1:
        state = conn.poll()
        if state == extensions.POLL_OK:
            break
        elif state == extensions.POLL_READ:
            wait_read(conn.fileno(), timeout=timeout)
        elif state == extensions.POLL_WRITE:
            wait_write(conn.fileno(), timeout=timeout)
        else:
            raise psycopg2.OperationalError(
                "Bad result from poll: %r" % state)
```
