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
From the course: Building a Personal Portfolio with Django
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Creating the models in Django5m 9s
-
Postgres setup for Django5m 27s
-
Connecting your Django project to Postgres4m 52s
-
Make Django migrations and migrate3m 56s
-
Setting up an admin panel in Django4m 20s
-
Creating model objects via the admin panel in Django3m 48s
-
Pulling objects from the database in Django5m 52s
-
-
-
-