sudo-i-u postgres
psql -U postgres -h localhost
postgres@shaikh:~$ psql
postgres=# create database local_test;
CREATE DATABASE
postgres=# grant all privileges on database local_test to postgres;
GRANT
postgres=# ALTER USER postgres WITH PASSWORD 'postgres';
ALTER ROLE
postgres=# exit()
Generate ssh profile to pull the project from github
cd ~/.ssh/
ssh-keygen -t ed25519 -C"amin@test.com"
Copy the public key and put inside your github setting SSH keys with a valid name
cat id_ed25519.pub
Create a folder for git projects and clone the repo
cd ~/
mkdir projects
cd projects/
git clone git@github.com:shaikhalamin/backend-project.git
Create a virtual environment and activate the venv
python3.10 -m venv venv
source venv/bin/activate
Now CD into the project directory and install the requirements along with Gunicorn server
cd backend-project/
pip install-r requirements.txt
pip install gunicorn
sudo ufw status
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
# For posgres from another serversudo ufw allow 5432/tcp
sudo ufw enable
sudo ufw status
If everything goes well install certbot for SSL certificated
sudo snap install--classic certbot
sudo ln-s /snap/bin/certbot /usr/bin/certbot
[N:B]
# Setup domain name and point to the correct IP and check from DNS checker then run the below commandsudo certbot --nginx
Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.
Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.
Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.
A simple “thank you” goes a long way—express your gratitude below in the comments!
Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.
Top comments (0)