Forums

Custom consoles - status display

Dear PA,

I'm loving the named Custom Consoles feature you have nowadays. My joy would be even more complete if one could display a status message for each console in the Dashboard Console list from the running python app - there's plenty of space on the right! I assume it's not trivial, so could it perhaps be added to the wish list for the putative PythonAnywhere API, if that's still going please?

Thanks, Jim

let me see if i've understood this correctly -- you want to be able to call some sort of api from a script that's running inside a console, which then publishes a "status" value to a field you'll be able to see on the consoles page?

Thanks harry - yep, that's it.

Any likelihood of this one? ;----)

I've added it to the list, but it would be pretty tricky; right now, the code running in a console doesn't really know which console it's running in. Perhaps if we automatically set an environment variable (say, PYTHONANYWHERE_CONSOLE_ID) and then you could make an API call to say "set the status for console ID XXXXX to "Foo"...? That might not be too hard.

OTOH these statuses would only update when you visited or refreshed the page. Would that be enough? Or were you thinking of something that would live-update?

Thanks Giles. I like the approach with the environment variable and a PA API call, and presumably this could be used for various other API options involving consoles.

A 'live update' status would be icing on the cake, but definitely lower priority.

Is the API wish list published somewhere so that people could think about it and contribute?

Jim

OK, I've noted that with a +1. There's no official wishlist for the API -- it's just a set of tickets in our regular issue/feature tracking system. These forums are probably the best place to discuss...

Thanks Giles. Any chance of showing those wishlist items here sometime? ;---)

Best if we keep it private, for the sake of your sanity ;-) There are over 4,000 items on it -- many of them relating to internal infrastructural changes that we shouldn't make public . On the plus side, we do keep track of upvotes, so we know what's popular.

My sanity went long ago, but point taken!

But I was really just asking about the occasionally-discussed API?

Well, on a quick scan through, we have:

  • 5018 Status field for consoles, updatable via the API (one upvote)
  • 4869 API for site hit data (two upvotes)
  • 5018 API for getting disk quota information (one upvote)
  • 4948 API for scheduled task / console process lists (one upvote)
  • 4680 API for posting code to run in your (paid) PythonAnywhere account (one upvote)
  • 3896 API for monitoring CPU usage (three upvotes)
  • 3878 API for reloading a web app (three upvotes)
  • 3295 API for monitoring scheduled tasks (one upvote)
  • 3003 API for file upload/download (no upvotes)

Many thanks Giles. I see there's less interest than I thought there was, but maybe this will spark a bit more!

Any chance for web app export to Docker containers? (Naturally, a corresponding API would be extra nice.)

That's probably something we'll look at doing at some point, but when is still an open question.