Web Development — Deployment

buzonliao
Python 101
Published in
1 min readOct 17, 2023
Photo by Sergey Zolkin on Unsplash

Elevate your web development journey by deploying your Flask project on PythonAnywhere. In this guide, we’ll walk you through every step — from initiating your web project to configuring a virtual environment. Dive deep into setting up Flask and efficiently exporting package details. By the conclusion, you’ll confidently have your web server operational on PythonAnywhere, showcasing your creations to the world. Enhance your web development prowess with us.

Deploy web server to PythonAnywhere

  1. Export packages info
pip3 freeze > requirements.txt

2. Register and go to Dashboard on https://www.pythonanywhere.com/

3. Create a web project

4. Go to bash and git clone your Flask project

5. Setup virtual env

mkvirtualenv --python=/usr/bin/python3.9 my-virtualenv

5. Install Flask

pip install flask

6. Activate virtual env

workon my-virtualenv

7. Go to the project directory and install packages

pip install -r requirements.txt

8. Go to the web tab and set the virtual env path

9. Reload the path and open it

Sample: http://buzonxxxx.pythonanywhere.com/

Reference

--

--