The PythonAnywhere newsletter, September 2017

Gosh, and we were doing so well. After managing a record seven of our “monthly” newsletters back in 2016, it’s mid-September and we haven’t sent a single one so far this year :-( Well, better late than never! Let’s see what’s been going on.

Read more…

Outage report: 20, 21 and 22 July 2017

We had several outages over the last few days. The problem appears to be fixed now, but investigations into the underlying cause are still underway. This post is a summary of what happened, and what we know so far. Once we’ve got a better understanding of the issue, we’ll post more.

It’s worth saying at the outset that while the problems related to the way we manage our users’ files, those files themselves were always safe. While availability problems are clearly a big issue, we regard data integrity as more important.

Read more…

Using the PythonAnywhere API: an (open source) helper script to create a Django webapp with a virtualenv

With the beta launch of our API, we want to start making it possible for people to do more scripted things with PythonAnywhere.

Our starter for 10 was this: our web-based UI has some helpers for creating new web apps for common web frameworks (Django, Flask, web2py, etc), but they pin you to the system-installed version of those packages. Using a virtualenv would give the user more flexibility, but currently that means using the more complicated “manual config” option.

The API means it’s now possible to build a single command-line tool that you can run from a PythonAnywhere console to create, from scratch, a new Django project, with a virtualenv, all in one go.

Read more…

The PythonAnywhere API: beta now available for all users

We’ve been slowly developing an API for PythonAnywhere, and we’ve now enabled it so that all users can try it out if they wish. Head over to your accounts page and find the “API Token” tab to get started.

The API is still very much in beta, and it’s by no means complete! We’ve started out with a few endpoints that we thought we ourselves would find useful, and some that we needed internally.

Read more…

System update this morning

This morning’s system update went well :-)

There aren’t any major visible new features in the new system – it was primarily an infrastructural change. The operating system on our underlying servers has been upgraded from Ubuntu 14.04 to 16.04 (so we had to rewrite all of our upstart system jobs as systemd ones, which was… fun). The sandboxes where your code runs have been kept as Ubuntu 14.04, so that your code doesn’t break due to the system it runs on changing unexpectedly.

A future update, hopefully soon, will enable a 16.04-based system image that you’ll be able to opt in to use when it’s convenient to you. There’s also a big new feature that we’re working on that required the OS upgrade – more about that another time…

Read more…

Tomorrow's system update cancelled

At the last minute, we discovered a bug in the version of PythonAnywhere we were planning to deploy tomorrow. We’re pretty certain about the fix, but rather than rush code into the live system without thorough testing, we’re delaying the system update. We hope it’ll all be ready to go early next week.

New release! Python 3.6 :-)

Today’s system update was mostly infrastructure changes and security fixes, but there’s one big visible change – we now support Python 3.6!

The new version is only available for accounts using the new dangermouse image, so if you’d like to be switched over and get not just the latest Python, but also new shiny versions of all of our installed system images, just send us a message using the “Send feedback” link.

Blocked in Russia

A week ago, one of the sites we were hosting was reported to us by the Russian authorities (specifically, the Federal Service for Supervision in the Sphere of Telecom, Information Technologies and Mass Communications [ROSKOMNADZOR]) for hosting illegal content. They said that we must take it down, or risk having the associated IP address blocked in Russia.

Read more…

New release! File sharing, and some nice little fixes and improvements

Honestly, it’s strange. We’ll work on a bunch of features, care about them deeply for a few days or weeks, commit them to the CI server, and then when we come to deploy them a little while later, we’ll have almost forgotten about them. Take today, when Glenn and I were discussing writing the blog post for the release

  • “Not much user-visible stuff in this one was there? Just infrastructure I think…”
  • “Let’s have a look. Oh yes, we fixed the ipad text editor. And we did the disable-webapps-on-downgrade thing. Oh yeah, and change-webapp-python-version, people have been asking for that. Oh, wow, and shared files! I’d almost totally forgotten!”

So actually, dear users, lots of nice things to show you.

Read more…

Building a simple Telegram bot using PythonAnywhere

Update 2024-06-20: it should work on free accounts again!

On 2020-01-12 we updated the original post with the following comment:

For some reason Telegram has stopped accepting wildcard HTTPS certificates for bots, so unfortunately this tutorial will no longer work on a PythonAnywhere free account. For the webhooks part of the tutorial to work, you will have to get a paying account with a custom domain. Thanks to fivechar for letting us know in the comments.

On 2024-06-18 user FizzFanatic posted on our forums that webhook solution is working on free accounts – and it looks like it is, thanks!

Original post

There’s an explosion of chat apps and bots at the moment, and it’s easy to see why. They’re a useful new way of interacting with computer systems, they’re interesting to code, and they’re actually surprisingly easy to create.

This blog post shows how you can get a simple bot up and running, using Telegram. Telegram isn’t as popular a messaging platform as WhatsApp or Skype, but it’s much easier to build bots for. You’ll need a normal computer and also a phone on which you can install the Telegram app. When you’ve finished working through the steps here, you’ll have a bot that can have an almost-plausible conversation with you.

It uses PythonAnywhere, which probably isn’t very surprising given the name of this blog ;-) You can do everything in here using a free PythonAnywhere account, and the bot you wind up with will be fully-functional. You’ll only need a paid-for account if your bot starts getting lots of users – of the order of thousands of messages a day.

So, without further ado, let’s get started!

Read more…