Quick & Easy Django Deployment on PythonAnywhere

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 - provies 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

  1. Go to Web
  2.  + Add a new web app 
  3. Next
  4. Django
  5. Choose the latest available version for Python and Django
  6. Choose a project name
  7. Next (wait some seconds)

 

Creating a virtual environment

  1. Go to Consoles
  2. Start a Bash Console
     

    Creating the virtual environment

    mkvirtualenv jaimedcsilva --python=/usr/bin/python3.10

     

    Activating the virtual environment

    workon jaimedcsilva



    Installing Django

    pip install django

     

  3. Go back to Web and scroll down to: Virtualenv 
    For me having a username jaimedcsilva38130 and a virtual environment jaimedcsilva the path is:

    /home/jaimedcsilva38130/.virtualenvs/jaimedcsilva
     

 

Preparing to go local

  • In Consoles, go to the Bash Console
  • Zip the Django project in the root:
    zip -r mysite.zip mysite/
  • In Files, download your project by clicking in the download icon 

 

 


Local computer
 

  • While in your computer unzip the project 
  • Add localhost to the ALLOWED_HOSTS
    ALLOWED_HOSTS = ['localhost', 'jaimedcsilva38130.pythonanywhere.com']
  • Developing: make any necessary modifications to your project

 

Preparing to go to production

Before you finish, set DEBUG to False

DEBUG = False


 

 

Pythonanywhere
 

  • Go to Files and upload your zipped project (maxium size for a single file is ≈ 100MB)


     
  • In Consoles, go to the Bash Console and unzip the project
    unzip mysite.zip
  • Go to Web and reload the web app

Django



20 Nov. 2025 | Last Updated: 05 Dec. 2025 | jaimedcsilva

Related
  • Using ngrok with Django
  • Opening a Django project through a .exe file
  • Creating an online store with Django
  • CRUD
  • Creating a Basic Django Project Automatically
  • Filter Horizontal in a custom template
  • GeoIP tracking with IpInfo and Django
  • GeoIP tracking with MaxMind and Django
  • Django User Agents
  • Generating Temporary Download Links
  • Cython - Hiding the Code of a Django Project
  • Quick & Easy Django Deployment on PythonAnywhere
  • A Brief History of Django
  • Django & Paypal Webhooks
  • Generating QR Codes with Django

  • Buy Me a Coffee