From 00a4b48439290c1040433f21761249f0d6ba5377 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Tue, 9 Mar 2021 16:55:39 -0500 Subject: [PATCH] Update django.md --- django.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/django.md b/django.md index 5fdcc5e..563d9f7 100644 --- a/django.md +++ b/django.md @@ -27,7 +27,7 @@ Let's create a new django project. Go to where on your computer you want your a django-admin startproject django_rest_api ``` -This is kind of `npm init`. Now, go run +This is kind of `npm init`. Now, run ``` cd django_rest_api @@ -39,16 +39,18 @@ This will move into your project dir and create an app called `contacts_api`. A Now let's get Postgres hooked up to Django. Start your postgres server, open Postgres, and choose any sub database. Once in there, create a sub database that our project will use: ``` -CREATE DATABASE django_contacts; +CREATE DATABASE django_api; ``` +**NOTE:** the db name can be whatever you want, so long as `NAME` in the next step matches it + Now edit django_rest_api/settings.py: ```python DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'django_contacts', + 'NAME': 'django_api', 'USER': '', 'PASSWORD': '', 'HOST': 'localhost'