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:
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:
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:
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:
In your terminal, you can launch into an existing virtual environment by typing in the following command:
You can then leave the virtual environment by typing in the following command:
Your Django Development Environment is now ready to be used.
Hope you found this post helpful.
In later posts, I will write about some more aspects of the Django web framework.