VickTree
VickTree

Reputation: 909

alternative to webapp2.WSGIApplication after migrating to google cloud ndb

I migrated from google.appengine.ext.webapp and ran into an issue with webapp2.WSGIApplication. I am using Django as the backend

the main part looks like this

application =webapp2.WSGIApplication([
                                       ('/warmup', warmupHandler)
                                       ('/api/layer', LayerService),
                                        debug=False)

def main():
     google.appengine.ext.webapp.util.run_wsgi_app(application)

if __name__ == '__main__':
     main()

I have tried using this code snippet provided by google cloud as a replacement and it did no help.

def wsgi_middleware(app): client = ndb.Client()

 def middleware(request):
     with client.context()
          return app(request)

 return middleware

They also have code snippits but i think this is for Flask, and i use django

def ndb_wsgi_middleware(wsgi_app):
    def middleware(environ, start_response):
        with client.context():
            return wsgi_app(environ, start_response)

    return middleware 

In the current setup I have, all I get is a 404 error. Meaning its not picking up the templates

Upvotes: 0

Views: 200

Answers (0)

Related Questions