Skip to content

Commit 19f786e

Browse files
authored
Merge pull request DjangoGirls#1150 from emazzotta/patch-1
Clarify simplest view example
2 parents a16615c + 69406fe commit 19f786e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

en/django_views/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Not too much stuff here yet.
2121

2222
Remember that lines starting with `#` are comments – this means that those lines won't be run by Python.
2323

24-
The simplest *view* can look like this:
24+
Let's create a *view* as the comment suggests. Add the following minimal view below it:
2525

2626
{% filename %}blog/views.py{% endfilename %}
2727
```python
2828
def post_list(request):
29-
return render(request, 'blog/post_list.html', {})
29+
return render(request, 'blog/post_list.html')
3030
```
3131

3232
As you can see, we created a function (`def`) called `post_list` that takes `request` and `return` a function `render` that will render (put together) our template `blog/post_list.html`.

0 commit comments

Comments
 (0)