Loading

Quipoin Menu

Learn • Practice • Grow

flask / Deploy on PythonAnywhere
tutorial

Deploy on PythonAnywhere

PythonAnywhere is a free hosting platform for Python web apps. It supports Flask, has a web interface, and is beginner‑friendly.

Step 1: Prepare Your Flask App

Make sure your Flask app is structured with `app.py` (or a proper package). All dependencies should be in `requirements.txt`:
pip freeze > requirements.txt

Step 2: Create a PythonAnywhere Account

Go to pythonanywhere.com, sign up for a free account.

Step 3: Upload Your Code

Use the "Files" tab to upload your project files (or clone from GitHub).

Step 4: Set Up a Web App

1. Go to "Web" tab, click "Add a new web app".
2. Choose "Flask" as the framework.
3. Select Python version (3.10 or later).
4. Set the path to your Flask app file (e.g., `/home/username/mysite/app.py`).
5. Set the working directory.
6. Click "Reload".

Step 5: Configure Environment Variables

In the "Web" tab, under "Environment variables", add `SECRET_KEY` and any API keys.

Step 6: Test Your App

Your app will be available at `username.pythonanywhere.com`.


Two Minute Drill
  • PythonAnywhere offers free Flask hosting.
  • Upload code via Files tab or GitHub.
  • Set up a web app with correct path and working directory.
  • Set environment variables for secrets.
  • Reload after changes.

Need more clarification?

Drop us an email at career@quipoinfotech.com