AWS RDS PostgreSQL With Django - PostgreSQL Database With Django

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello I am a full stack developer and a top Credit Plus freelancer at upwork.com [Music] Amazon relational database service is fully managed relational database service provided by Amazon web services it makes it easy to set up operate and scale a relational database in the cloud to configure an Amazon web services relational database service postgres SQL database with Django you have to follow these steps first of all you have to create an AWS account if you don't have then you have to launch an RDS instance then you have to configure Django to use the RDS instance then you have to migrate your Django models okay and at the end you have to test your connection okay first we have to launch an RDS instance you have to log into your AWS account when you are logged in just type RDS in search bar and select first one foreign option here for engine option we will choose postgre SQL and we will keep the latest version of engine variant okay and here we will choose free tire okay next we have to give a name to our DB okay so I will give name backend course all right next we have to give a name to our Master username database okay so here I will give name my super user okay then I will create a password my super user my super user okay then we have to keep our instance configuration to micro okay so we will not change anything here to the storage it's up to us how much storage we need okay so you can increase decrease storage as well okay so next we have to keep the settings by default don't connect to the ec2 compute resource okay and next this is important we have to select yes okay so we can access our database okay and next we have to create a security group I will give name back end okay so this will be our Security Group here we have to check additional configuration so I will use this port 5432 next we have additional configuration okay so we can keep it by default here you need to give name to your database name it is very important if you miss this okay so your database will not work so I will give name backend course all right okay so then we have to just create our database okay I will just create database okay one thing here you need to make sure the name is uh compatible with AWS okay so I will just also update my database name as well okay here okay this is here okay all right okay so let's create our database now foreign button okay it will take 2-3 minutes to create your RDS okay so you have to wait for it sometime it takes five to six minutes as well okay so RDS is creating for mean time we can do some configuration in our Django project okay go to your Django project and settings.pi file okay so we will replace these database by default configuration how you can do it you have to replace with these lines okay I will add this article Link in my video description copy these lines go to your settings.pi file and replace these lines okay I will just replace it okay so no here we need to add our database name so my database name is backend course okay and my database username is my super user okay and my password is my super user okay all right so now we have to copy the host when our RDS will be created so we can copy the host and we can replace this host okay so before we copy the host let's install some packages okay so if we want to integrate postgresql we need to install two packages okay okay first you have to install this package okay on my side it is already installed next you have to install binary package okay all right okay when you are done then you make sure to add these two packages in your requirements.txt file how you can do it you can just to pip freeze requirements dot txt okay so your requirement.txt file will be updated with these two packages okay so now we are done with our configuration just we need to know copy The Host now let me go to our RDS Let me refresh it okay so RDS is being credited so we can wait all right okay so let's just open our RDS okay so this is our host endpoint just copy this okay and then you have to replace here all right okay next we have to do one thing we have to add a security group inbound role okay just click on Security Group Okay click on Security Group okay go to the inbound roles click added inbound rules so here you need to make sure your system IP address is added okay so then your connection will be established otherwise your connection will not establish okay all right now we can run migrations okay python manage start by migrate okay so we can migrate our database to RDS all right we are connected with our RDS okay so our migrations are successful in case your migration don't succeeded it's mean there is an issue with your security growth so make sure security group of your IP address is added all right so we can now create a super user python manage dot Pi create super user I will give name admin admin at the rate gmail.com okay so we have password as well all right okay so we can run our app locally so we can try to add some data okay just copy the development server path okay all right go to the admin path okay so we have admin username and admin password just click on login button okay now here you can see we can add some data in our tables okay so I will add some data category name shoes details okay and then we can add a product Okay add a new product name you can say baby shoes all right you can enter the price and you can choose the image all right and you need to select the category for your product okay so no we have added the database so we have a serverless database okay so if we deploy our project to any cloud provider okay so we can use the same uh database okay all right so we can now push our changes to GitHub that's it so you should now be able to use your AWS RDS postgres SQL instance with your Django application I hope this video has been helpful don't forget to like share and subscribe my YouTube channel if you have any questions or feedback leave a comment below I will get back to you stay tuned for more courses and tutorials and until next time goodbye
Info
Channel: CodeWithMuh
Views: 2,780
Rating: undefined out of 5
Keywords: RDS, AWS RDS PostgreSQL With Django, PostgreSQL Database With Djang, create AWS RDS Postgres instance, django with postgresql, Amazon RDS for PostgreSQL, code with muh, codewithmuh, aws, devops, programming, database, django rest framework, sql, mysql, python, aws services, amazon rds, aws rds, aws rds tutorial
Id: O3jyQ3wJeoc
Channel Id: undefined
Length: 12min 26sec (746 seconds)
Published: Fri Feb 17 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.