Install and setup Django with PostgreSQL or SQLite, Nginx with Gunicorn or Apache with wsgi on virtual environment.
- Setup Region and Local Zone on OS
sudo apt install python3-pip python3-dev python3-venv
sudo apt install curl git sqlite3 build-essential
sudo ufw allow 8000
sudo ufw delete allow 8000
sudo ufw allow 'Nginx Full'
mkdir ~/dummyapp
cd ~/dummyapp
sudo -H pip3 install --upgrade pip
sudo -H pip3 install virtualenv
virtualenv venv
source venv/bin/activate
For install Django on Nginx with Gunicorn (english howto - italian howto) for multiple site and specific virtual environment view folder nginx-gunicorn
For install Django on Apache with WSGI (english howto - italian howto) for multiple site and specific virtual environment view folder apache-wsgi
sudo apt install libpq-dev postgresql postgresql-contrib
- verify
client_encoding TO 'UTF-8'
timezone TO 'UTC or YOUR TIMEZONE'
default_transaction_isolation TO 'read committed'
sudo systemctl status postgresql
sudo systemctl start postgresql
orsudo pg_ctlcluster 12 main start
sudo systemctl enable postgresql
sudo -u postgres psql
CREATE DATABASE dummydb;
CREATE USER dummyuser WITH PASSWORD 'dummypassword';
GRANT ALL PRIVILEGES ON DATABASE dummydb TO dummyuser;
\q