diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index 168cda5dd8..14bcb5ecb3 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -15,7 +15,7 @@ Before we do anything else we'll create a new virtual environment, using [venv]. ```bash python3 -m venv env -source env/bin/activate +source env/bin/activate # On Windows use `env\Scripts\activate` ``` Now that we're inside a virtual environment, we can install our package requirements. @@ -217,6 +217,10 @@ Let's look at refactoring our serializer using the `ModelSerializer` class. Open the file `snippets/serializers.py` again, and replace the `SnippetSerializer` class with the following. ```python +from rest_framework import serializers +from snippets.models import Snippet + + class SnippetSerializer(serializers.ModelSerializer): class Meta: model = Snippet @@ -362,9 +366,9 @@ Quit the server with CONTROL-C. In another terminal window, we can test the server. -We can test our API using [curl][curl] or [httpie][httpie]. Httpie is a user friendly http client that's written in Python. Let's install that. +We can test our API using [curl][curl] or [HTTPie][HTTPie]. HTTPie is a user-friendly http client that's written in Python. Let's install that. -You can install httpie using pip: +You can install HTTPie using pip: ```bash pip install httpie @@ -436,5 +440,5 @@ We'll see how we can start to improve things in [part 2 of the tutorial][tut-2]. [repo]: https://github.com/encode/rest-framework-tutorial [venv]: https://docs.python.org/3/library/venv.html [tut-2]: 2-requests-and-responses.md -[httpie]: https://github.com/httpie/httpie#installation +[HTTPie]: https://github.com/httpie/httpie#installation [curl]: https://curl.haxx.se/