MENU
Django
With the rapid progress of data science in the 2010s, Python, through its machine learning modules such as scikit-learn, has become one of the most widely used programming languages. Django is a popular high-level Python web framework.
To see Django in action on Ubuntu, first install it and create a superuser:
sudo apt-get install python3 python3-pip
pip3 install Django
cd /var/www
django-admin startproject django_app
cd django_app
python3 manage.py migrate
python3 manage.py createsuperuser
To allow external hosts to access the web interface, first edit settings.py:
vi django_app/settings.py
Add the line: ALLOWED_HOSTS = ['192.168.0.22'] where 192.168.0.22 is the local IP address. To obtain the address:
ip route get 8.8.8.8 | awk '{print $NF; exit}'
Then launch the server:
python3 manage.py runserver 0.0.0.0:8000
...and enter in the address bar of a browser:
192.168.0.22:8000
192.168.0.22:8000/admin
Other web frameworks for Python include TurboGears , web2py , and CherryPy .