Python anywhere что это
Возьми Python с собой
Думали ли вы (в очередной раз подготавливая среду для Python) о том, как было бы здорово, если бы не приходилось настраивать с нуля рабочее окружение (да ещё и под разными операционными системами), а можно было бы сесть и просто начать писать? Я случайно открыл для себя pythonanywhere.com — сервис, позволяющий вести разработку на Python онлайн, прямо в браузере. Под катом — описание сервиса с картинками и видео.
У меня сейчас настроены несколько Windows и Linux компьютеров, синхронизирован исходный код через Dropbox и заведён microinstance на Amazon EC2. Всё это заняло уйму времени и не очень удобно — бывает идею хочется проверить «в поле», и рядом нет настроенной с любовью среды. Что же предлагает PythonAnywhere?
Прежде чем читать длинное описание, предлагаю посмотреть видео, кратко рассказывающее о сервисе:
Также можно ознакомиться с выступлением разработчика Harry Percival на PyCon UK 2011 (хорошее знание английского приветствуется, но и без него можно многое понять из презентации):
В конце выступления Гарри не хватило времени и он вынужден был бегать по залу, чтобы у него не отобрали микрофон.
Программируем на Python в интернет
PythonAnywhere — это среда для разработки на Python непосредственно в браузере плюс хостинг для этих проектов. Если у вас есть браузер и доступ в интернет, то у вас есть всё, что нужно. Серверы уже настроены, на них имеется то что может понадобиться. Теперь легко взять с собой свою среду разработки — начните проект на рабочем компьютере, а потом продолжите с того места, где остановились, но уже на своём ноутбуке.
Владельцы айпадов торжествуют!
Теперь питоноводы могут писать приложения на iPad, с телефона или даже на «умном» телевизоре (smart TV) так же легко, как раньше делали это на своих компьютерах. PythonAnywhere работает на iPad и скоро будет готова версия для Android. Вы можете писать свои программы в веб-редакторе или запустить консольную сессию из-под любого современного браузера, поддерживающего HTML5. Уже не надо настраивать свой собственный сервер или платить за его настройку.
А что за кадром?
PythonAnywhere использует сервера Amazon (EC2), а мы можем использовать все преимущества этого подхода. Для быстрой разработки несложных приложений не понадобится платить ни копейки. А в случае мощных и ресурсоёмких задач — оплатим только использованные ресурсы.
Помимо того, имеется интеграция с DropBox, можно синхронизировать свои данные и код. При помощи командной строки легко работать с git, mercurial или subversion проектами на GitHub, Bitbucket и любом другом публичном репозитории.
Поддерживается не только Django: Flask, Bottle, web2py — любой WSGI веб-фреймворк будет работать и скорее всего уже установлен (см. батарейки). В качестве баз данных можно использовать MySQL и SQLite, рассматривается возможность добавления MongoDB и PostgreSQL.
Имеется аналог cron — можно запланировать запуск скриптов (не только Python) по расписанию.
Можно посмотреть логи доступа и ошибок веб-сервера.
Приступаем к работе
Регистрация не занимает много времени и сразу после подтверждения email-адреса можно начинать пользоваться сервисом.
Django версии 1.3.1. С помощью easy_install я без проблем смог проапгрейдить Django до текущего релиза 1.4:
Создаём новый Django-проект — для этого идем на вкладку Web и нажимаем большую кнопку «New Django App»:
Для обычного Python проекта без веб-фреймворков просто создаём файл на вкладке Files и сразу попадаем в веб-редактор; после окончания редактирования готовый файл можно сохранить и тут же запустить на выполнение — откроется всплывающее окно с консолью, в которой будет выполняться наш скрипт.
Продолжим с Django — нам предлагают ввести имя проекта и папку для его хранения:
Мы можем использовать папку, предлагаемую по умолчанию или сохранить проект в DropBox.
Небольшие нюансы, связанные с DropBox:
1) Желательно, чтобы ваш email в PythonAnywhere совпадал с email-ом в DropBox — ведь мы расшарим папку с проектом для «dropbox@pythonanywhere.com» и он должен соотнести эту папку с вашим аккаунтом. Если email не совпадает — на вкладке Files справа вверху нажимаем ссылку «Connect to DropBox» и указываем наш email в DropBox. Нам покажут в картинках как в DropBox расшарить свою папку для этого сервиса.
2) Создать проект прямо в каталоге
/Dropbox нельзя — придется пользоваться подкаталогом, примерно так:
/Dropbox/PythonAnywhereProjects/myproject. Техподдержка намекает что это временное явление, мол сейчас идёт развитие сервиса и они пока ограничены в возможностях.
3) Нельзя просто удалить расшаренную папку из Dropbox — в таком случае она навсегда останется в PythonAnywhere и её не удастся удалить даже из консоли, т.к. на это у нас нет прав доступа. Поэтому предварительно на сайте DropBox-а уберите доступ к расшаренной папке для пользователя «dropbox@pythonanywhere.com». После этого папка исчезнет из PythonAnywhere и её можно будет спокойно удалить в DropBox.
Итак, я использовал синхронизацию с DropBox:
Дальше — создаём нужные файлы и редактируем их в веб-редакторе (или запускаем в bash-консоли vim/emacs). Если надо создать приложение в Django-проекте — используем bash-консоль:
Базу данных создаём на вкладке «MySQL», там же задаём пароль пользователя.
После того, как создали файлы — нужно перезагрузить веб-сервер. Для этого служит кнопка «Reload web app» на вкладке «Web».
Если хотите запускать несколько веб-приложений одновременно — техподдержка предлагает создать несколько аккаунтов с тем же email, в дальнейшем появится такая возможность на одном аккаунте.
Другие применения
Возможно вам нужно будет посоветоваться с коллегой — очень легко расшарить любую сессию. Для подключения вашему коллеге не нужно будет даже регистрироваться на сервисе — достаточно указать его email и он получит ссылку на текущую консольную сессию.
Быть может у вас есть блог о программировании с пошаговыми примерами — можно дать возможность читателям прямо на страницах блога тренироваться в программировании. Достаточно добавить этот код:
Каждый читатель получит свою собственную консоль, состояние которой будет сохраняться при переходе от страницы к странице.
Или вы ведете оффлайн-курс по программированию на Python. Прискорбно тратить первое занятие на ожидание, когда же все новички закончат настройку окружения под вашим руководством. Вместо этого можно предложить зарегистрироваться на PythonAnywhere и уже через несколько минут вплотную приступить к учебному процессу.
Не стоит зацикливаться на Python, ведь тут имеется и bash-консоль. Например, мы можем поддерживать постоянное SSH-соединение со сторонним хостом (обслуживаемый вами сервер и т.п.). Тогда если нам вдруг понадобится срочно подключиться, а мы будем например в гостях — достаточно будет браузера, консоль ждет нас в том состоянии, в каком мы её оставили.
Ещё это хорошая альтернатива Google App Engine (а может даже и некоторым платным Python хостингам). Уверен, вы сможете придумать и другие варианты.
Plans and pricing
All of our paid plans come with a no-quibble 30-day money-back guarantee — you’re billed monthly and you can cancel at any time. The minimum contract length is just one month. You get unrestricted Internet access from your applications, unlimited in-browser Python, Bash and database consoles, and full SSH access to your account. All accounts (including free ones) have screen-sharing with other PythonAnywhere accounts, and free SSL support (though you’ll need to get a certificate for your own domains).
Create a Hacker account
Create a Web Developer account
Create a Startup account
Create a Custom account
What are «CPU seconds»?
With every PythonAnywhere account, you get a number of CPU-seconds included each day. This applies to all code run through our in-browser consoles, in your scheduled tasks and in your always-on tasks, but does not apply to your web apps.
A CPU-second is one second of full-power usage on a High Frequency Intel Xeon E5-2670 v2 (Ivy Bridge) Processor (one CPU core on an Amazon AWS m3.xlarge instance). Your code only uses up CPU seconds while it’s actually busy. If your code isn’t using any CPU power (maybe it’s not running, or it’s waiting for input or for a web request to return) then it’s not using any CPU seconds.
If you use up all of your included CPU seconds, don’t worry! You can always buy more — and even if you don’t, your processes will still run, in the tarpit.
Tarpitted processes run at a lower priority than users who haven’t hit their limit yet, but they get any spare capacity that we have on our server cluster, unless they’re using gigabytes of RAM.
What do we mean by a «typical» website? Why don’t we just guarantee a certain number of hits/day capacity?
We guarantee a certain amount of computing capacity for your web app, but how many hits/day you can get out of that depends on you. If you write a website that does tons of calculations for every request then you won’t be able to handle as many hits per day as our estimate. If you write a super-efficient one using a lightweight framework, you’ll be able to handle more.
Our estimates are based on real-world websites that we host, like web2py.com, so we’re confident that they’re a good indicator of what a typical website will be able to handle.
How it works, under the hood
The web app compute capacity is defined by the number of web workers associated with your app. Each web worker is an independent process capable of serving up your entire app, so if you have more than one, while one is busy handling one request another can take over. If you only have one worker (or if all of your workers are busy) then requests are queued up and served when a worker becomes available.
For sites without a lot of traffic — even if they have a lot of users accessing pages occasionally — one web worker is enough. But when things get busy, if two people happen to hit your app at exactly the same time, it’s useful to have more than one.
Making things faster with static files
Static files (that is, stuff that doesn’t change frequently and that you store in simple files on the disk, rather than creating dynamically with your Python code — like CSS files or JavaScript) can be configured to be served separately, without tying up your web workers, using the «Static files» section of the web app configuration page.
Host, run, and code Python in the cloud!
Get started for free. Our basic plan gives you access to machines with a full Python environment already installed. You can develop and host your website or any other code directly from your browser without having to install software or manage your own server.
Start hosting quickly
Just write your application. No need to configure or maintain a web server — everything is set up and ready to go.
Develop anywhere
Take your development environment with you! If you have a browser and an Internet connection, you’ve got everything you need.
Teach and learn
PythonAnywhere is a fully-fledged Python environment, ready to go, for students and teachers — concentrate on teaching, not on installation hassles.
Amazing support
Need help with PythonAnywhere? If you get in touch, you can talk directly with the development team. Help for developers, from developers.
Get a Python website in minutes
We make a normally complicated process very simple, letting you focus on creating exciting applications for your users. Launching a new Django project is a simple process taking just a couple of minutes. No need to manage a web server or maintain a Linux machine. No need to install security patches. It just works.
Your choice
We have quickstart installers for Django, web2py, Flask, and Bottle — we can also handle any other WSGI web framework that you want to use, and it’s probably already installed.
— Barun Saha (@1barun) October 12, 2017
— Chandramowli J (@ChaMowJack) October 10, 2017
There is no easier Python hosting experience, IMHO.
— Paul Barry (@barrypj) July 31, 2017
wow deploying a django app to @pythonanywhere was very easy, nice service
— Pybites (@pybites) July 18, 2017
Launched another site on @pythonanywhere using #Flask, they couldn’t make it any easier!
— SeekWell (@SeekWell_io) June 23, 2017
With #web2py + #pythonanywhere was actually really easy to deploy a WebApp.
— Kristian Kanchev (@KanchevKristian) May 1, 2017
@pythonanywhere Great initiative. Amazing service! Good job! Quickly host python apps with complete python environment! With free plan
— Tiago Marques (@tapmarques) February 14, 2017
Gotta love how easy it is to stand up a Django web app with @pythonanywhere
— Kevin Earl Denny (@kevinearldenny) January 17, 2017
I’m in love with @pythonanywhere.
Deploying my python projects have never been easier.
— Fadilullah (@__olamilekan__) December 1, 2016
@pythonanywhere best hosting ever.
— Buczacka Walter (@DeWalltt) November 11, 2016
Down tools. Move over to @pythonanywhere with their game changing support. The only guys in town when it comes to #Django #Python
— Robert Johnstone (@reliableitsys) October 21, 2016
Anaconda from @ContinuumIO + @pythonanywhere + @github = great way to learn webdev w/ Flask. Make your teacher a mentor online. Geek out!
— Kirby Urner (@4DsolutionsPDX) July 31, 2016
@pythonanywhere is the real deal when it comes to web hosting; so easy getting your site up and running. #kickass
— George Thomas (@tibugeorge) 9 June 2016
Have been playing around with #Python (3.5) and #Django on @pythonanywhere. Very, very cool and powerful!
— J. M. Varner (@JMVarnerBooks) 6 June 2016
Thanks @pythonanywhere for making it so easy to dploy our site Built using @django and deployed via @GitHub in http://yourusername.pythonanywhere.com/ works for everyone.
Easy scaling
Python coding on the web: 22,460,377 consoles served!
PythonAnywhere makes it easy to create and run Python programs in the cloud. You can write your programs in a web-based editor or just run a console session from any modern web browser. There’s storage space on our servers, and you can preserve your session state and access it from anywhere, with no need to pay for, or configure, your own server. Start work on your work desktop, then later pick up from where you left off by accessing exactly the same session from your laptop.
Just a semi-regular reminder that the wonderful @pythonanywhere are wonderfully wonderful. 🙂
— Nicholas Tollervey (@ntoll) November 15, 2017
Oh @pythonanywhere I love you! Just so easy to have a friendly environment to play in. Of course I love #python too!
— Psylica Labs (@PsylicaLabs) May 5, 2017
Making a @SlackHQ-bot using @api_ai, a python script hosted on @pythonanywhere that pulls data from @airtable: it’s great to live in #2017!
— Michiel Rutjes (@michielrutjes) February 13, 2017
@pythonanywhere I’ve just finished configuring my 🐍 script on your servers. Incredibly fast to deploy. Great service, guys.
— El Gonzi (@GonzaloRMDT) February 12, 2017
For whipping up something when you are not in your environment, @pythonanywhere is very impressive, even free tier.
— Michael Wexler (@mwexler) December 7, 2016
I’m in love with @pythonanywhere.
Deploying my python projects have never been easier.
— Fadilullah (@__olamilekan__) December 1, 2016
The service which brings me the most value? @pythonanywhere. Running apps in the cloud without worrying about my laptop battery running out.
— Joseph MacMillan (@JoeMacM38) November 5, 2016
Just signed up for @pythonanywhere and I’m loving it. I wish Ive used it since I started coding.
— Fabio Rosa (@fabiomrosa) November 5, 2016
The simplicity on @pythonanywhere 365.242 days a year, we’re there for you. Got a question or a comment about PythonAnywhere? Need some help? Just post in our forums, drop a line to support@pythonanywhere.com, or send us feedback, and one of our dev team will get back to you right away.
Here are some of the characters you’ll meet:
Giles Thomas | Glenn Jones | Conrad Ho | Filip Łajszczak | Piotr Kaznowski |
Thank u @pythonanywhere teams 4 the super responsive support and clear tutorials. My site is now up and running 😍😇
— Geneva Sapphire (@GenevaSapphire) November 3, 2017
Great choice indeed — we’ve never had a problem with their wonderful service, and their customer support response time is amazing!
— Nightwave Studios (@VaduNightwave) September 19, 2017
How have ssl on my site. Thanks to the super helpful people at @pythonanywhere! Your tutorials are great.
— David Love (@Dvlv292) June 28, 2017
Down tools. Move over to @pythonanywhere with their game changing support. The only guys in town when it comes to #Django #Python
— Robert Johnstone (@reliableitsys) October 21, 2016
Thank you to @pythonanywhere and @gpjt again for being awesome! #startup #entrepreneur #Python #django #support #customerservice
— Robert Johnstone (@reliableitsys) 21 April 2016
@pytohs Je confirme que chez @pythonanywhere ils sont très gentils. Leur S.A.V est très choupinet.
— SamEtMax (@sam_et_max) 15 February 2016
@pythonanywhere #amazing #support. And it just works. I installed #pylint per instructions in a flash. #python #cloud #teaching #delight
— Tom Harris (@teachingengr) 24 September 2015
the folks at @pythonanywhere not only provide an awesome platform but also amazing support service. If you code #python you need to try it
— j.k. silver (@jksilver47) 25 August 2015
Could Reddit’s @pythonanywhere testimonials be any more persuasive? #cloud #development #Python #PaaS
— Cameron Laird (@Phaseit) 27 January 2015
A Python learning environment
with everything ready to go
A full Python environment, with no setup hassle
Python is a great language for teaching, but getting it installed and set up on all your students’ computers can be less than easy. PythonAnywhere provides an environment that’s ready to go — including a syntax-highlighting, error-checking editor, Python 2 and 3 consoles, and a full set of batteries included. Avoid all the hassles of getting Python installed on everyone’s laptop, and making sure everyone can pip install all the right packages.
Distributing assignments and monitoring progress is easy
Once a student has nominated you as their teacher, you can see their files and Python consoles, so you can help them more easily. You can copy files into their accounts so that you can give them a starting point for their assignments, and you can see their solutions.
We can even create student accounts in bulk for you, and pre-populate them with files that you provide — just let us know!
All your students have the same environment
The same operating system, the same console, the same text editor — save yourself from having to customise your lessons and instructions for Windows/Mac/Linux, and from having to debug issues in different shells and editors.
. and they can work together
Your students can choose to share their consoles with each other, too — so they can work on group projects remotely, or help each other in-class.
Start work at work or at school, and continue at home
Because PythonAnywhere is web-based, it can follow you around on any computer (or iPad, or Chromebook) with a browser, so you or your students can work from wherever you like.
What does it cost?
It’s free! Our basic accounts are free, and we only charge for more advanced services (like professional web app hosting, or big number-crunching requirements), none of which are needed for basic «intro to programming» type courses. If you need larger amounts of processing power, then get in touch — you can also get an idea of our prices on the pricing page.
Limitations
Our education support is evolving rapidly, and there are a few limitations right now; check out this help page for the current list.
So you can concentrate on teaching, not installing software.
We’re using PythonAnywhere as a tutorial aid. Much better than spending the first hour making sure everyone has Python installed.
PythonAnywhere used for teaching Python, avoids installation hassles. Handy, esp. when as a first language!
Host, run, and code Python in the cloud!
Get started for free. Our basic plan gives you access to machines with a full Python environment already installed. You can develop and host your website or any other code directly from your browser without having to install software or manage your own server.
Need more power? Upgraded plans start at €5/month.
Start hosting quickly
Just write your application. No need to configure or maintain a web server — everything is set up and ready to go.
Develop anywhere
Take your development environment with you! If you have a browser and an Internet connection, you’ve got everything you need.
Teach and learn
PythonAnywhere is a fully-fledged Python environment, ready to go, for students and teachers — concentrate on teaching, not on installation hassles.
Amazing support
Need help with PythonAnywhere? If you get in touch, you can talk directly with the development team. Help for developers, from developers.
Get a Python website in minutes
We make a normally complicated process very simple, letting you focus on creating exciting applications for your users. Launching a new Django project is a simple process taking just a couple of minutes. No need to manage a web server or maintain a Linux machine. No need to install security patches. It just works.
Your choice
We have quickstart installers for Django, web2py, Flask, and Bottle — we can also handle any other WSGI web framework that you want to use, and it’s probably already installed.
— Barun Saha (@1barun) October 12, 2017
— Chandramowli J (@ChaMowJack) October 10, 2017
There is no easier Python hosting experience, IMHO.
— Paul Barry (@barrypj) July 31, 2017
wow deploying a django app to @pythonanywhere was very easy, nice service
— Pybites (@pybites) July 18, 2017
Launched another site on @pythonanywhere using #Flask, they couldn’t make it any easier!
— SeekWell (@SeekWell_io) June 23, 2017
With #web2py + #pythonanywhere was actually really easy to deploy a WebApp.
— Kristian Kanchev (@KanchevKristian) May 1, 2017
@pythonanywhere Great initiative. Amazing service! Good job! Quickly host python apps with complete python environment! With free plan
— Tiago Marques (@tapmarques) February 14, 2017
Gotta love how easy it is to stand up a Django web app with @pythonanywhere
— Kevin Earl Denny (@kevinearldenny) January 17, 2017
I’m in love with @pythonanywhere.
Deploying my python projects have never been easier.
— Fadilullah (@__olamilekan__) December 1, 2016
@pythonanywhere best hosting ever.
— Buczacka Walter (@DeWalltt) November 11, 2016
Down tools. Move over to @pythonanywhere with their game changing support. The only guys in town when it comes to #Django #Python
— Robert Johnstone (@reliableitsys) October 21, 2016
Anaconda from @ContinuumIO + @pythonanywhere + @github = great way to learn webdev w/ Flask. Make your teacher a mentor online. Geek out!
— Kirby Urner (@4DsolutionsPDX) July 31, 2016
@pythonanywhere is the real deal when it comes to web hosting; so easy getting your site up and running. #kickass
— George Thomas (@tibugeorge) 9 June 2016
Have been playing around with #Python (3.5) and #Django on @pythonanywhere. Very, very cool and powerful!
— J. M. Varner (@JMVarnerBooks) 6 June 2016
Thanks @pythonanywhere for making it so easy to dploy our site Built using @django and deployed via @GitHub in http://yourusername.eu.pythonanywhere.com/ works for everyone.
Easy scaling
A €5 Hacker account at PythonAnywhere can easily support a 10,000 hit/day website. But when your site grows and you need to support 100 times that traffic, we’re still there — you just need to upgrade your account.
Python coding on the web: 203,493 consoles served!
PythonAnywhere makes it easy to create and run Python programs in the cloud. You can write your programs in a web-based editor or just run a console session from any modern web browser. There’s storage space on our servers, and you can preserve your session state and access it from anywhere, with no need to pay for, or configure, your own server. Start work on your work desktop, then later pick up from where you left off by accessing exactly the same session from your laptop.
Just a semi-regular reminder that the wonderful @pythonanywhere are wonderfully wonderful. 🙂
— Nicholas Tollervey (@ntoll) November 15, 2017
Oh @pythonanywhere I love you! Just so easy to have a friendly environment to play in. Of course I love #python too!
— Psylica Labs (@PsylicaLabs) May 5, 2017
Making a @SlackHQ-bot using @api_ai, a python script hosted on @pythonanywhere that pulls data from @airtable: it’s great to live in #2017!
— Michiel Rutjes (@michielrutjes) February 13, 2017
@pythonanywhere I’ve just finished configuring my 🐍 script on your servers. Incredibly fast to deploy. Great service, guys.
— El Gonzi (@GonzaloRMDT) February 12, 2017
For whipping up something when you are not in your environment, @pythonanywhere is very impressive, even free tier.
— Michael Wexler (@mwexler) December 7, 2016
I’m in love with @pythonanywhere.
Deploying my python projects have never been easier.
— Fadilullah (@__olamilekan__) December 1, 2016
The service which brings me the most value? @pythonanywhere. Running apps in the cloud without worrying about my laptop battery running out.
— Joseph MacMillan (@JoeMacM38) November 5, 2016
Just signed up for @pythonanywhere and I’m loving it. I wish Ive used it since I started coding.
— Fabio Rosa (@fabiomrosa) November 5, 2016
The simplicity on @pythonanywhere 365.242 days a year, we’re there for you. Got a question or a comment about PythonAnywhere? Need some help? Just post in our forums, drop a line to eusupport@pythonanywhere.com, or send us feedback, and one of our dev team will get back to you right away.
Here are some of the characters you’ll meet:
Giles Thomas | Glenn Jones | Conrad Ho | Filip Łajszczak | Piotr Kaznowski |
Thank u @pythonanywhere teams 4 the super responsive support and clear tutorials. My site is now up and running 😍😇
— Geneva Sapphire (@GenevaSapphire) November 3, 2017
Great choice indeed — we’ve never had a problem with their wonderful service, and their customer support response time is amazing!
— Nightwave Studios (@VaduNightwave) September 19, 2017
How have ssl on my site. Thanks to the super helpful people at @pythonanywhere! Your tutorials are great.
— David Love (@Dvlv292) June 28, 2017
Down tools. Move over to @pythonanywhere with their game changing support. The only guys in town when it comes to #Django #Python
— Robert Johnstone (@reliableitsys) October 21, 2016
Thank you to @pythonanywhere and @gpjt again for being awesome! #startup #entrepreneur #Python #django #support #customerservice
— Robert Johnstone (@reliableitsys) 21 April 2016
@pytohs Je confirme que chez @pythonanywhere ils sont très gentils. Leur S.A.V est très choupinet.
— SamEtMax (@sam_et_max) 15 February 2016
@pythonanywhere #amazing #support. And it just works. I installed #pylint per instructions in a flash. #python #cloud #teaching #delight
— Tom Harris (@teachingengr) 24 September 2015
the folks at @pythonanywhere not only provide an awesome platform but also amazing support service. If you code #python you need to try it
— j.k. silver (@jksilver47) 25 August 2015
Could Reddit’s @pythonanywhere testimonials be any more persuasive? #cloud #development #Python #PaaS
— Cameron Laird (@Phaseit) 27 January 2015