How to deploy project on PythonAnywhereΒΆ
Use pip to install Jam.py. To do this, open up a new Bash console from the Consoles Tab and run:
mkvirtualenv --python=/usr/bin/python3.13 my-virtualenv # use whichever python version you prefer pip install jam.py-v7
The above mkvirtualenv command might display:
created virtual environment CPython3.10.5.final.0-64 in 8486ms creator CPython3Posix(dest=/home/username/.virtualenvs/my-virtualenv, ...
The dest path is used for Virtualenv section. For every user, this will be different.
Create a zip archive of your project folder, upload the archive in the Files tab and unzip it.
We assume that you are registered as username and your project is now located in the /home/username/project_folder directory.
Open the Web Tab. Add a new web app. In the Code section specify:
Source code: /home/username/project_folder
Working directory: /home/username/project_folder
WSGI configuration file: /var/www/username_pythonanywhere_com_wsgi.py file,
delete everything and add just the following code:
import os import sys path = '/home/username/project_folder' if path not in sys.path: sys.path.append(path) from jam.wsgi import create_application application = create_application(path)
In the Static files section, specify the Jam.py static files location and the path. For example:
URL: /static/
Directiory: /home/username/project_folder/static
In the Virtualenv section, specify the virtual environment path created with above mkvirtualenv command. For example:
/home/username/.virtualenvs/my-virtualenv/
In the Force HTTPS section, enable HTTPS.
Reload the server on Reload section.
To debug the process, review the logs on Logs section.