Update django.md

main
Matt Huntington 5 years ago committed by GitHub
parent c8a413b963
commit 00a4b48439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 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 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: 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: Now edit django_rest_api/settings.py:
```python ```python
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql', 'ENGINE': 'django.db.backends.postgresql',
'NAME': 'django_contacts', 'NAME': 'django_api',
'USER': '', 'USER': '',
'PASSWORD': '', 'PASSWORD': '',
'HOST': 'localhost' 'HOST': 'localhost'

Loading…
Cancel
Save