Question

Configuring the remote_api for AppEngine on Python 2.7, I need to set up the configuration calls to create and configure the dabase call stubs so that I don't have to replicate the configuration call in every REST resource and handler. The code I want to have is something similar to this:

def configure_remote_api():
    try:
        from google.appengine.ext.remote_api import remote_api_stub
        remote_api_stub.ConfigureRemoteApi(None, '/_ah/remote_api', auth_func, 'myapp.appspot.com')
    except ImportError:
        pass

What I want is to set it up so it is modularly called, and doesn't have to be replicated all over the application code, not even configure_remote_api(). This way, we can keep our codebase clean and have automatic remote_api use whenever developing locally. How can I do this?

Was it helpful?

Solution

Maybe you can put the call in appengine_config.py. That usually gets loaded pretty early on. (But please check.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top