@@ -15,7 +15,7 @@ Before we do anything else we'll create a new virtual environment, using [venv].
1515
1616``` bash
1717python3 -m venv env
18- source env/bin/activate
18+ source env/bin/activate # On Windows use `env\Scripts\activate`
1919```
2020
2121Now 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.
217217Open the file ` snippets/serializers.py ` again, and replace the ` SnippetSerializer ` class with the following.
218218
219219``` python
220+ from rest_framework import serializers
221+ from snippets.models import Snippet
222+
223+
220224class SnippetSerializer (serializers .ModelSerializer ):
221225 class Meta :
222226 model = Snippet
@@ -362,9 +366,9 @@ Quit the server with CONTROL-C.
362366
363367In another terminal window, we can test the server.
364368
365- 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.
369+ 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.
366370
367- You can install httpie using pip:
371+ You can install HTTPie using pip:
368372
369373``` bash
370374pip install httpie
@@ -436,5 +440,5 @@ We'll see how we can start to improve things in [part 2 of the tutorial][tut-2].
436440[ repo ] : https://github.com/encode/rest-framework-tutorial
437441[ venv ] : https://docs.python.org/3/library/venv.html
438442[ tut-2 ] : 2-requests-and-responses.md
439- [ httpie ] : https://github.com/httpie/httpie#installation
443+ [ HTTPie ] : https://github.com/httpie/httpie#installation
440444[ curl ] : https://curl.haxx.se/
0 commit comments