pythonanywhere with Django

The Django tool is a Python based tool to present Web Pages. It is a full function tool that does it all. pythonanywhere.com encourages use of Django for students of the tool.

A typical Web Page.

Most web pages have four parts to the them. From top to bottom, start with the header and it’s navigation links. On the left or right side are more navigation links. The middle page of the page is the main topic of the web page with clickable links as well. At the bottom are the footer links.

“https://steelkiwi.com/blog/top-10-django-website-examples/” presents these examples as outstanding Django examples.

Disqus

Instagram

Dropbox

Spotify

The Washington Post

Mozilla

Pinterest

National Geographic

The Onion

NASA

As previously mentioned pythonanywhere.com provides a virtual computer sandbox. uname is the command in Linux to find out what operating system is running. It’s Linux as expected. The “aws” designation implies pythoneverywhere.com is hosted on Amazon Web Services.

$ uname -a

Linux green-liveconsole2 5.4.0-1029-aws #30 SMP Tue Nov 10 18:03:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux(mysite-virtualenv) 04:17 ~

 

Here are the instructions from

“https://help.pythonanywhere.com/pages/DeployExistingDjangoProject”

to get started with Django. The original command in this first line sets up the virtual Python environment to Django

$ mkvirtualenv –python=/usr/bin/python3.8 mysite-virtualenv

Running virtualenv with interpreter /usr/bin/python3.8

Already using interpreter /usr/bin/python3.8

Using base prefix ‘/usr’

New python executable in /home/allenabc/.virtualenvs/mysite-virtualenv/bin/python3.8

Also creating executable in /home/allenabc/.virtualenvs/mysite-virtualenv/bin/python

Installing setuptools, pip, wheel…

done.

virtualenvwrapper.user_scripts creating /home/allenabc/.virtualenvs/mysite-virtualenv/bin/predeactivate

virtualenvwrapper.user_scripts creating /home/allenabc/.virtualenvs/mysite-virtualenv/bin/postdeactivate

virtualenvwrapper.user_scripts creating /home/allenabc/.virtualenvs/mysite-virtualenv/bin/preactivate

virtualenvwrapper.user_scripts creating /home/allenabc/.virtualenvs/mysite-virtualenv/bin/postactivate

virtualenvwrapper.user_scripts creating /home/allenabc/.virtualenvs/mysite-virtualenv/bin/get_env_details

(mysite-virtualenv) 04:04 ~/DJango $

Next..

For Django

“https://help.pythonanywhere.com/pages/DeployExistingDjangoProject”

 

Press the Web button on the main page, then press the green button to start a default Django Web page. This web page is available anywhere on the Internet

 

 

The default Django web page looks like this

http://<your name>.pythonanywhere.com/

 

 

Now that you having a working Django example you may want to explore the technology.

 

At the bottom of the Demo page are three buttons. Django Documentation, Tutorial A Polling App and Django Community.

Select the Tutorial Option and get started learning

 

Back on the console you may be missing the Django Module.

pip3 install django

to fix that