Self-Hosting Quill on PythonAnywhere

PythonAnywhere’s free tier is a good fit for Quill: you get a persistent server, HTTPS out of the box, and a simple WSGI-based deployment model. The one constraint is that the free tier has no Node.js, so you can’t build the React frontend on the server. This guide handles that by building locally and committing the build to the repo.


What you’ll need


Step 1: Build the frontend locally

Vite is configured to write the build output directly into backend/dist/, where Flask expects to find it.

cd frontend
npm install
npm run build

Add the build to your commit:

git add backend/dist
git commit -m "Build frontend"
git push

Do this every time you change frontend code before deploying.


Step 2: Set up PythonAnywhere

Log in to PythonAnywhere and open a Bash console from the Dashboard.

Clone your repo:

git clone https://github.com/yourusername/quill.git

Create a virtual environment and install dependencies:

cd quill/backend
python3 -m venv venv
source venv/bin/activate
pip install flask flask-cors werkzeug python-dotenv

Step 3: Create your .env file

In the backend/ directory, create a .env file. This file is gitignored — it never leaves the server.

nano .env

Add:

SECRET_KEY=pick-a-long-random-string-here
ALLOWED_ORIGINS=https://yourusername.pythonanywhere.com

Replace yourusername with your actual PythonAnywhere username. The SECRET_KEY can be anything long and random — it signs your session cookies, so keep it private.


Step 4: Configure the WSGI file

In the PythonAnywhere Dashboard, go to Web and click Add a new web app. Choose:

Once created, click the link to edit the WSGI configuration file. Replace everything in it with:

import sys
import os

project_home = '/home/yourusername/quill/backend'
if project_home not in sys.path:
    sys.path.insert(0, project_home)

# Load .env
from dotenv import load_dotenv
load_dotenv(os.path.join(project_home, '.env'))

from app import app as application

Replace yourusername with your PythonAnywhere username.


Step 5: Set the virtualenv path

Still in the Web tab, find the Virtualenv section and enter the path to your virtual environment:

/home/yourusername/quill/backend/venv

Step 6: Reload and test

Click Reload at the top of the Web tab. Visit https://yourusername.pythonanywhere.com — you should see Quill’s splash screen.

If something is broken, click on the Error log link in the Web tab. The most common issues:


Deploying updates

When you make backend changes:

# On PythonAnywhere, in a Bash console:
cd ~/quill
git pull
# Then hit Reload in the Web tab

When you make frontend changes:

# Locally:
cd frontend
npm run build
git add backend/dist
git commit -m "Build frontend"
git push

# On PythonAnywhere:
git pull
# Hit Reload in the Web tab

Notes on the free tier