Skip to content

Commit 7182aee

Browse files
author
Adam Charnock
committed
Minor updates to django-quickstart
1 parent a4e225d commit 7182aee

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/pages/docs/quickstart-django.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ working with Django simple.
1111
If you need help getting started with django then head over to
1212
Django's getting started page.
1313

14-
First let's create a few simple models
14+
First let's create a few simple models...
1515

16-
## Some models
16+
## Defining our models
1717

18-
Let's get started with these models **in an app called ingredients**:
18+
Before continuing, create the following:
19+
20+
* A Django project called `cookbook`
21+
* An app within `cookbook` called `ingredients`
22+
23+
Let's get started with these models:
1924

2025
```python
2126
# cookbook/ingredients/models.py
@@ -34,24 +39,25 @@ class Ingredient(models.Model):
3439
## Schema
3540

3641
GraphQL presents your objects to the world as a graph structure rather than a more
37-
heiricarcal structure to which you may be acustomed. In order to create this
42+
hierarchical structure to which you may be accustomed. In order to create this
3843
representation, Graphene needs to know about each *type* of object which will appear in
3944
the graph. Below we define these as the `UserType` and `GroupType` classes.
4045

4146
This graph also has a 'root' through which all access begins. This is the `Query` class below.
4247
In this example, we provide the ability to list all users via `all_users`, and the
43-
ability to obtain a single user via `get_user`.
48+
ability to obtain a specific user via `get_user`.
4449

45-
Open `tutorial/quickstart/schema.py` and type the following:
50+
Create `cookbook/ingredients/schema.py` and type the following:
4651

4752
```python
53+
# cookbook/ingredients/schema.py
4854
import graphene
4955
from graphene.contrib.django import DjangoObjectType
5056

5157
from django.contrib.auth.models import User, Group
5258

5359
# Graphene will automatically map the User model's fields onto the UserType.
54-
# This is configured in the UserType's Meta class
60+
# This is configured in the UserType's Meta class (as you can see below)
5561
class UserType(DjangoObjectType):
5662
class Meta:
5763
model = User

0 commit comments

Comments
 (0)