Skip to content

Commit 87efc02

Browse files
authored
Update README.md
Adapt according to @ekohl's suggestions
1 parent 78b499d commit 87efc02

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

en/django_views/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +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
28-
from django.shortcuts import render
29-
3028
def post_list(request):
31-
return render(request, 'blog/post_list.html', {})
29+
return render(request, 'blog/post_list.html')
3230
```
3331

3432
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)