Use this guide to set up a Django Development Environment on PythonAnywhere.

Step 1: Login to your PythonAnywhere account, open a bash console and check the python version by typing in the following command:

python --version

Default python version on PythonAnywhere

Step 2: To set up our Python 3.6+ environment, we’ll need to issue the following command:

mkvirtualenv myvirtualenv --python=/usr/bin/python3.6

The newly created virtual environment will be activated by default

Confirm the setup by typing in the following command:

which pip

This will print the location in which the active pip binary is located - hopefully within .virtualenvs and myvirtualenv

To see what packages are already installed, type in the following command:

pip list

Step 3: Now we can customize the virtual environment by installing the required packages for our Django application. Install all the required packages by typing in the following commands:

pip install django==2.1.5

pip install pillow==5.4.1

pip install django-registration-redux==2.2

pip install requests

pip install coverage

Step 4: After installing the above packages, check if Django has been installed by typing in the following command:

which django-admin.py

In your terminal, you can launch into an existing virtual environment by typing in the following command:

workon myvirtualenv

You can then leave the virtual environment by typing in the following command:

deactivate

Your Django Development Environment is now ready to be used.

Cheers!