sudo apt install python3
if needed
sudo apt install python3-pip
pip install -r requirements.txt
\# Create the file repository configuration:
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
\# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
\# Update the package lists:
sudo apt-get update
\# Install the latest version of PostgreSQL.
\# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql':
sudo apt-get -y install postgresql
It should match with your linux username
sudo -u postgres createuser --createdb <username>
createdb <database_name>
psql -d <database_name> -f database.sql
psql <database_name>
ALTER ROLE <username> WITH PASSWORD '<password>'
\q
sudo apt install gunicorn
touch .env
nano .env
DATABASE_URL=postgresql://<username>:<password>@localhost:5432/<database_name>
gunicorn -w 5 -b 127.0.0.1:8000 app:app