From the course: Building a Personal Portfolio with Django

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Connecting your Django project to Postgres

Connecting your Django project to Postgres

From the course: Building a Personal Portfolio with Django

Start my 1-month free trial

Connecting your Django project to Postgres

- [Instructor] So we've created a new database in PostGreS. Now we need to let our Django project know about it and connect to it. So let's go ahead and move back in to Adam. Remember here in the setting.py we have the database that was there by default. This that sqLite3 database, we want to change this now to point to our PostgreS database and we're going to have to put in a lot of different information to make this all work, so let's just go ahead and take it line by line and get there. So starting first with the engine, we're going to delete what we have for this django.db.backend.sqLite3. Instead of sqLite3, we're going to tell Django that we want work with a PostGreS database. So we're going to type in here: PostGresql, okay, all one word there, keep that django.db.backends.postgresql. Next, for the name: this is simply just going to be whatever the name of our database is. So we're remember when we were naming this we decided to call it portfoliodb? Well, we just simply type…

Contents