Support wsgi deployment and fix login bug