Is it possible to use bundled services (with Python) in DEV without dev_appserver.py?

I'm revisiting this  because I now have my apps using Python 3.11 (Python27 is gone) and the SDK/CLI 472, which I think has the latest updates for Python. However, I still get this error:

google.appengine.runtime.apiproxy_errors.RPCFailedError: Attempted RPC call without active security ticket

when I try to use any of the functionality in google.appengine.api unless I run my apps in DEV using dev_appserver.py

Things run well when deployed to PROD (gcloud), so this happens only in the development environment when I try to run an app the way Google recommends, which I believe is this:

drive:\path_to_python\python.exe main.py

In fact, most of my apps I still run them in DEV using dev_appserver.py because I heavily rely on functionality encapsulated within google.appengine.api, but I have a couple of apps that are rather simpler and never used anything within bundled services, so I can run them without dev_appserver.py. The thing is that as soon as I want to use some of the functionality in google.appengine.api (e.g. email, memcache) I get that strange error and it's only in DEV.

Am I missing anything? Is there a way around that?

Note: I have no problem with using dev_appserver.py except for the fact that it seems to be slated for deprecation (eventually) and it's not even supported on Windows, so one has to depend on this patch that is not maintained by Google (thanks @NoCommandLine  for your support with that patch!)

 

1 3 263
3 REPLIES 3

Hi @micdearmas,

Welcome to Google Cloud Community!

While using bundled services with Python in a development environment for Google App Engine currently requires dev_appserver.py, there are ongoing discussions and feature requests. You can keep monitoring the filed request for future updates on potential support without dev_appserver.py.

In the meantime, consider these approaches to modernize your development workflow and potentially enhance functionality:

Hope this clarifies your concerns.

Hi,

There are several reasons why dev_appserver.py is still needed unless Google creates modern replacement for it or does away with a reason for needing it

  1. GAE requires app.yaml to work. dev_appserver.py uses it. Standard python tools don't. It's common to see people test their app locally using python/flask main.py, deploy to production and then complain they get 404 on some of their routes. This is because the route handler in their app.yaml wasn't tested.
  2. dev_appserver.py allows you to test running multi-service architecture (test it locally) and you can't do this out of the box with standard python tools. The tool also allows you test GAE Prod restrictions like maximum size of an input payload.
  3. Folks using dev_appserver.py also already use virtual environments to create isolated environments

One reason why folks use bundled services is because Unbundled Google Cloud Products don't have mocks or local emulators which means they don't work locally (when testing locally, you still have to connect to the cloud and store your data in cloud; this also means you can't test/work when you don't have internet connection e.g. while travelling)

 

    ......NoCommandLine ......
https://nocommandline.com
        Analytics & GUI for 
App Engine & Datastore Emulator

 

Thanks  @jaydubu and @NoCommandLine for your inputs. I agree with @NoCommandLine about the benefits of using bundled services, I wouldn't want to stop using them (or having to scramble looking for alternatives to do what it's so easy with them) and that's why I'm trying to be able to use them even if I didn't have dev_appserver.py any longer, which would be a challenge in itself in part for reasons outlined in @NoCommandLine 's response .

Seeing that Google is not recommending the use of dev_appserver.py any more is a bit of a concern because (as of now) without it one cannot use bundled services (not even using the latest Python version). I thought maybe after all upgrades to the GAE Python runtime maybe I was missing something and it was in fact possible, but from @jaydubu 's response I gather it is still not possible.

I'm already using a virtual environment for each app that is turn used by dev_appserver.py with the flag --python_virtualenv_path, so I guess I'll keep an eye out for future updates on potential support without dev_appserver.py or maybe the news that  dev_appserver.py is here to stay after all 😉

Thanks.