#!python

# this is here and not just a console_script entry point because we want the
# gevent monkeypatching to happen before any pieces of baseplate are imported
# at all, as would happen if we were to have this code be in the baseplate
# package.

from gevent.monkey import patch_all

from baseplate.server.monkey import patch_stdlib_queues

patch_all()
patch_stdlib_queues()

try:
    import psycopg2
    from psycogreen.gevent import patch_psycopg

    patch_psycopg()
except ImportError:
    pass


from baseplate.server import load_app_and_run_server

load_app_and_run_server()
