Pythonanywhere
Create a pythonanywhere account in www.pythonanywhere.com
Go through the pythonanywhere quick tutorial.
Overview
- Dashboard - provides you a general view
- Consoles - allows you to interact with your webserver and project through consoles
- Files - provides a graphical interface to interact with your files
- Web - allows you to create a webapp for a Django project
- Forums - provides you a good support system
- Account - lets you manage account plans and configurations
Creating a Web app
- Go to Web
- + Add a new web app
- Next
- Manual configuration (including virtualenvs)
- Choose the Python version
- Next (wait some seconds)
Creating a virtual environment
- Go to Consoles
- Start a Bash Console
Creating the virtual environment
mkvirtualenv myfirstenv --python=/usr/bin/python3.10Activating the virtual environment
workon myfirstenv
Installing Django and Pillowpip install django pip install Pillow -
Go back to Web and scroll down to: Virtualenv
For me having a username jaimedcsilva38130 and a virtual environment myfirstenv the path is:
/home/jaimedcsilva38130/.virtualenvs/myfirstenv
Configuring the web server
- Scroll down to Code
- Sourcecode: /home/jaimedcsilva38130/mysite
- WSGI configuration file
import os import sys path = '/home/jaimedcsilva38130/mysite' if path not in sys.path: sys.path.append(path) os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' from django.core.wsgi import get_wsgi_application application = get_wsgi_application() - Scroll down to Static files and add the following entries for URL and Directory
Adjust to your username. In my case it's jaimedcsilva38130
URL Directory /static/ /home/jaimedcsilva38130/mysite/staticfiles /media/ /home/jaimedcsilva38130/mysite/media
Preparing to go to production
Before you finish, set DEBUG to False, whenever you are in production.
DEBUG = False
Add your pythonanywhere domain to ALLOWED_HOSTS
Add localhost as well for whenever you bring the project back to development.
ALLOWED_HOSTS = ['localhost', 'jaimedcsilva38130.pythonanywhere.com',]
Pythonanywhere
- Go to Files and upload your zipped project (maxium size for a single file is ≈ 100MB)

- In Consoles, go to the Bash Console
Unzip the project
Collect the static filesunzip mysite.zippython manage.py collectstatic - Go to Web
- Scroll down to Security and Force HTTPS
- Reload the web app

Tested with Django 5.2 Pythonanywhere
12 Nov. 2025
|
Last Updated: 23 Jan. 2026
|
jaimedcsilva Related