Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/tutorial/1-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/
Loading