Integrate PostgreSQL with Django on AWS EC2 | Setup PostgreSQL Database for Django Project
Learn how to integrate a PostgreSQL database with your Django project on an AWS EC2 server! This tutorial covers installing PostgreSQL, configuring the database settings in Django, creating and migrating database tables, and ensuring a secure connection. Perfect for developers looking to use PostgreSQL as a production database for their Django applications on AWS. Watch now to master PostgreSQL integration with Django on EC2!
sudo apt install postgresql postgresql-contrib -y
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo -i -u postgres
psql
CREATE DATABASE testproject;
CREATE USER django WITH PASSWORD 'mypassword';
ALTER ROLE django SET client_encoding TO 'utf8';
ALTER ROLE django SET default_transaction_isolation TO 'read committed';
ALTER ROLE django SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE testproject TO django;
\q
exit
sudo nano /etc/postgresql/14/main/postgresql.conf
listen_addresses = '*'
sudo nano /etc/postgresql/14/main/pg_hba.conf
host all all 0.0.0.0/0 md5
sudo systemctl restart postgresql
Go to AWS Console → EC2 → Security Groups.
Select the Security Group for your EC2 instance.
Click Edit inbound rules.
Add Rule:
Type: PostgreSQL
Protocol: TCP
Port Range: 5432
Source: 0.0.0.0/0
update in setting.py page
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'testproject',
'USER': 'django',
'PASSWORD': 'mypassword',
'HOST': '13.49.225.87',
'PORT': '5432',
}
}
source /home/ubuntu/djangoone/venv/bin/activate
pip install psycopg
sudo systemctl restart gunicorn
sudo systemctl restart nginx
python manage.py migrate
#Django #PostgreSQL #AWS #AWSEC2 #DjangoDatabase #DjangoTutorial #PythonDjango #AWSCloud #WebDevelopment #DatabaseIntegration
Видео Integrate PostgreSQL with Django on AWS EC2 | Setup PostgreSQL Database for Django Project канала TeluguPy
sudo apt install postgresql postgresql-contrib -y
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql
sudo -i -u postgres
psql
CREATE DATABASE testproject;
CREATE USER django WITH PASSWORD 'mypassword';
ALTER ROLE django SET client_encoding TO 'utf8';
ALTER ROLE django SET default_transaction_isolation TO 'read committed';
ALTER ROLE django SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE testproject TO django;
\q
exit
sudo nano /etc/postgresql/14/main/postgresql.conf
listen_addresses = '*'
sudo nano /etc/postgresql/14/main/pg_hba.conf
host all all 0.0.0.0/0 md5
sudo systemctl restart postgresql
Go to AWS Console → EC2 → Security Groups.
Select the Security Group for your EC2 instance.
Click Edit inbound rules.
Add Rule:
Type: PostgreSQL
Protocol: TCP
Port Range: 5432
Source: 0.0.0.0/0
update in setting.py page
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'testproject',
'USER': 'django',
'PASSWORD': 'mypassword',
'HOST': '13.49.225.87',
'PORT': '5432',
}
}
source /home/ubuntu/djangoone/venv/bin/activate
pip install psycopg
sudo systemctl restart gunicorn
sudo systemctl restart nginx
python manage.py migrate
#Django #PostgreSQL #AWS #AWSEC2 #DjangoDatabase #DjangoTutorial #PythonDjango #AWSCloud #WebDevelopment #DatabaseIntegration
Видео Integrate PostgreSQL with Django on AWS EC2 | Setup PostgreSQL Database for Django Project канала TeluguPy
Integrate PostgreSQL with Django PostgreSQL setup on AWS EC2 for Django Django PostgreSQL database configuration How to connect PostgreSQL with Django on EC2 AWS EC2 PostgreSQL setup for Django Configure PostgreSQL for Django on EC2 Django database connection with PostgreSQL AWS EC2 Set up PostgreSQL in Django on EC2 AWS EC2 PostgreSQL integration with Django Django PostgreSQL tutorial on AWS EC2 django tutorial in telugu django complete tutorial in telugu
Комментарии отсутствуют
Информация о видео
6 марта 2025 г. 17:30:55
00:18:54
Другие видео канала




















