sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv
sudo su
cd /opt/django/www
python3 -m venv myenv
source myenv/bin/activate
pip install django
django-admin startproject myrpi
# nano myrpi/settings.py
ALLOWED_HOSTS = [
'localhost',
'192.168.1.110',
'192.168.1.111'
]
python manage.py migrate
python manage.py makemigrations
python manage.py runserver 192.168.1.110:8000
deactivate
python manage.py startapp myapp
ls -la myapp
a2enmod wsgi
a2dismod wsgi
apache2ctl -t
apache2ctl -M
systemctl status apache2
systemctl enable apache2
systemctl restart apache2
virtualenv venv --python=python3.6
source venv/bin/activate
sudo chown -R www-data:www-data /opt/env/python/RestApi
sudo chown -R www-data:www-data /opt/www/flask/RestApi
nohup python RestApi/RestApi/__init__.py>RestApi.log &
ssh -L 5000:localhost:5000 [email protected]
apt install net-tools
ss -lptn 'sport = :5000'
netstat -nlp | grep :5000