O'Reilly logo

Head First Python, 2nd Edition by Paul Barry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Pythonanywhere: Deploying Your Webapp

image with no caption

At the end of Chapter 5, we claimed that deploying your webapp to the cloud was only 10 minutes away.

It’s now time to make good on that promise. In this appendix, we are going to take you through the process of deploying your webapp on PythonAnywhere, going from zero to deployed in about 10 minutes. PythonAnywhere is a favorite among the Python programming community, and it’s not hard to see why: it works exactly as you’d expect it to, has great support for Python (and Flask), and—best of all—you can get started hosting your webapp at no cost. Let’s check out PythonAnywhere.

Step 0: A Little Prep

At the moment, you have your webapp code on your computer in a folder called webapp, which contains the vsearch4web.py file and the static and templates folders (as shown below). To prepare all this stuff for deployment, create a ZIP archive file of everything in your webapp folder, and call the archive file webapp.zip:

image with no caption

In addition to webapp.zip, you also need to upload and install the vsearch module from Chapter 4. For now, all you need to do is locate the distribution file that you created back then. On our computer, the archive file is called vsearch-1.0.tar.gz and it’s stored in our mymodules/vsearch/dist folder (on Windows, the file is likely ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required