Django 3 - Start Django on PythonAnywhere

By Sheldon L Published at 2020-02-11 Updated at 2020-02-11


Start Django on PythonAnywhere

python3 --version
mkvirtualenv django3 --python=/usr/bin/python3.7
workon django3
pip install django
python3 -m django --version
mkdir djProjects
cd djProjects
git clone https://github.com/csev/dj4e-samples
cd dj4e-samples
pip install -r requirements.txt
python manage.py check
python manage.py makemigrations
python manage.py migrate

python3 manage.py createsuperuser
python3 manage.py runscript gview_load
python3 manage.py runscript many_load
cd ~/djProjects
django-admin startproject mysite
vim ~/djProjects/mysite/mysite/settings.py
"""/ upate ALLOWED_HOSTS
ALLOWED_HOSTS = ['*']
"""

cd ~/djProjects/mysite
python manage.py check
cd ~/djProjects
git init

# after create an empty ropo on github:
git remote add origin git@github.com:sheldonldev/djProjects_onPyAnyw.git
git add .
git commit -a

ssh-keygen -t rsa -C my_email@domain.com
cat ~/.ssh/id_rsa.pub

git push --set-upstream origin master
cd $hub/mysite_test
git clone git@github.com:sheldonldev/djProjects_onPyAnyw.git
pip freeze -> requirements.txt
git add .
git commit -a
git push

reference

Start First App

Adding HTTP