diff options
| author | Tom Christie | 2012-10-03 09:46:12 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-10-03 09:46:12 +0100 |
| commit | d8b05201edde0dd3b22d3b57ebeb04a2ed533b95 (patch) | |
| tree | 56ffc76eddfa3fc07da832f98d605767755d8493 /docs/tutorial/1-serialization.md | |
| parent | 1a05942166abfc68f83caea535aa44733b1e37a9 (diff) | |
| parent | 637bfa0f8f4f5be4b877109bd744aa66718ececc (diff) | |
| download | django-rest-framework-d8b05201edde0dd3b22d3b57ebeb04a2ed533b95.tar.bz2 | |
Merge branch 'restframework2' of https://github.com/tomchristie/django-rest-framework into restframework2
Diffstat (limited to 'docs/tutorial/1-serialization.md')
| -rw-r--r-- | docs/tutorial/1-serialization.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index cd4b7558..5d830315 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -78,7 +78,7 @@ Don't forget to sync the database for the first time. ## Creating a Serializer class -We're going to create a simple Web API that we can use to edit these comment objects with. The first thing we need is a way of serializing and deserializing the objects into representations such as `json`. We do this by declaring serializers, that work very similarly to Django's forms. Create a file in the project named `serializers.py` and add the following. +We're going to create a simple Web API that we can use to edit these comment objects with. The first thing we need is a way of serializing and deserializing the objects into representations such as `json`. We do this by declaring serializers that work very similarly to Django's forms. Create a file in the project named `serializers.py` and add the following. from blog import models from rest_framework import serializers @@ -201,7 +201,7 @@ The root of our API is going to be a view that supports listing all the existing Note that because we want to be able to POST to this view from clients that won't have a CSRF token we need to mark the view as `csrf_exempt`. This isn't something that you'd normally want to do, and REST framework views actually use more sensible behavior than this, but it'll do for our purposes right now. -We'll also need a view which corrosponds to an individual comment, and can be used to retrieve, update or delete the comment. +We'll also need a view which corresponds to an individual comment, and can be used to retrieve, update or delete the comment. @csrf_exempt def comment_instance(request, pk): @@ -231,7 +231,7 @@ We'll also need a view which corrosponds to an individual comment, and can be us comment.delete() return HttpResponse(status=204) -Finally we need to wire these views up, in the `tutorial/urls.py` file. +Finally we need to wire these views up. Create the `blog/urls.py` file: from django.conf.urls import patterns, url |
