Forums

Can I use an asgi server in pythonanywhere?

I am curious about real time django and channels and trying to follow this blogpost: https://blog.heroku.com/in_deep_with_django_channels_the_future_of_real_time_apps_in_django

However, it mentions asgi servers and redis. What would I need to integrate that with pythonanywhere?

At the moment, we cannot support ASGI on our infrastructure.

I've built a couple of ASGI apps using Starlette the last month and have been very very impressed with the performance difference possible with true async (One of them is running on a pi-zero and you would never guess that.) ASGI is the future, but right now.

Indeed, ASGI looks really good. We're planning to support it, but we don't have a timeline yet. It's worth noting, though, that our recent announcement of always-on tasks is one of the first steps in that direction.

Any closer to having an official timeline on ASGI support?

No, we're not any closer.

For all those looking for a solution...

If you have gotten to the point of getting a 200 error from what appears to be your redis server. Then you are close, but you had the same misconception as I did.

You must be able to process TCP calls and not just HTTP with redis relies on.

I have searched and searched, but couldn't find an answer.

If you're looking to use django-channels it appears you will have to go to another host. I personally was finally able to get up and running on Heroku and from what I can tell. It will do. When PythonAnywhere implements this feature I will definitely consider coming back, but for now, there's no other option :(

Are you supporting ASGI server in your infrastructure?, if yes, then which one. Thanks

No we do not support ASGI at the moment.

Any update on asgi support?

No update yet, no. We're working towards it but it will take a while because it requires major changes to the way we handle websites.

We're starting to see more ASGI projects, so looking forward to PythonAnywhere supporting it. :-)

Hi, is there any update in this context? Do you have an expected date? Just to know if I need to find alternatives. Thanks!

@fachu000 we don't have estimates as it is a complex feature to implement.

Just leaving a comment to add one more vote for demanding ASGI and django-channels functionalities. Also, I could not use django-celery and python threading before, so I had to redesign my website for using 'Always-on task'. It's working now though, now I need to find another get-around for WebSocket which feels like fundamentaly there must be big updates in async jobs in the future. But I like the overall service in pythonanywhere so far!

Ok. Thanks for the input.

I am adding my request for this as well. Much love to the whole PythonAnywhere team. I very much appreciate what this service has empowered me to do over the years.

Noted! Thanks!

Hi, are there any updates on ASGI support?

Not yet

Adding a request to this as well.

Noted!

I am also adding the same request!

Thanks! I've upvoted it on our list of suggested enhancements.

Hi, are there any updates on ASGI support?

It's on the way.

when does it release?

We do not provide release dates before we release something. We will release it when it is ready for use.

Thanks for the effort Glenn. This really means a lot. I knew this will be up someday. One reason I forced my team to use this host. Love from us at King’s Heart.

Hi, are there any updates on ASGI support?

We don't have any updates apart from what's been said above.

Happy 7th birthday to this ticket!

We should buy it a cake ;-)

Hy there, also looking forward to ASGI support, I would like to play around with Quart.

Hi, are there any updates on ASGI support?

Yes, there is! We should have posted to this forum thread. We are currently running a limited beta of ASGI support for websites. It is feature-limited right now:

  • There's no web interface to create and manage ASGI sites -- you have to use our API.
  • It only supports PythonAnywhere subdomains.
  • There is no static file support

However, if you're interested in testing it with those limitations, drop us a line at support@pythonanywhere.com. If you're interested in trying it out later on during our beta (perhaps when we've added a web interface, or something like that, please also let us know -- then we can ping you when the beta moves forward.

i dont get it how i setup my asgi beta then?

Drop us a line at support@pythonanywhere.com and we'll switch on the beta features for you.

However, that is API-only. The UI is on its way.