Home > Back-end >  How to access to the Interactive Console from a deployed application in Google App Engine Standard?
How to access to the Interactive Console from a deployed application in Google App Engine Standard?

Time:07-14

I have used the dev_appserver.py app.yaml --enable_console and I was able to make use of the Interactive Console by going to the url localhost:8000 or Web Preview and port 8000 using the Cloud Shell option.

But when I deployed the application into GAE Standard using the same app.yaml as in development:

runtime: python39

handlers:

 - url: /app
   script: main.py
 
- url: /admin/.*
   script: google.appengine.ext.admin.application
   login: admin

I can not access neither the console or the admin by using the the link provided in the Cloud Shell as: gcloud app browse and add it the /admin/ and other variations to the url.

Example:

  <project-name>.appspot.com/admin
  <project-name>.appspot.com/admin/
  <project-name>.appspot.com/admin/console

I am greeted with a Not Found page. I have also tried to use Postman and obtianed the same result.

How do I properly access the Interactive Console of a deployed application in Google App Engine?

Am I missing something?

CodePudding user response:

What is it that you are trying use the interactive console to do?

If youre just trying to interact with Google Datastore via ndb you just need to open a python shell in your terminal at your project root and initialize ndb with your project id:

$ python
>>> from google.cloud import ndb
>>> ndb_client = ndb.Client(project='my-project-id')
>>> ndb_context = ndb_client.context()
>>> ndb_context.__enter__()
>>> # start interacting with your datastore

If you get a permissions error, then I think that means that the google service account specified in your env variable GOOGLE_APPLICATION_CREDENTIALS doesnt have access to that project.

The same goes for other actions like enqueuing cloud tasks via the python library google-cloud-tasks

CodePudding user response:

  1. Don't know if what you're doing is possible but the script you have supplied doesn't seem to exist. This is a link to the google.appengine.ext module and it doesn't have the module you're referring to.

  2. Also not sure why you need the interactive console when you're on production given that you have console.cloud.google.com which gives you access to what the interactive console gives you. My understanding is that interactive console is for dev server only and is basically a simulation of what you get from console.cloud.google.com

  • Related