Fix getting engine in wsgi app