# blog/views.py

OK, vamos abrir o arquivo e ver o que tem nele:

```
from django.shortcuts import render

# Create your views here.
```

Não tem muita coisa. A view mais básica se parece com isto.

```
def post_list(request):
    return render(request, 'blog/post_list.html', {})
```

Como você pode ver, nós criamos um método (`def`) chamado `post_list` que aceita o pedido e `retorna` um método `render` será processado (para montar) nosso modelo `blog/post_list.html`.

Salve o arquivo, vá para seu endereço e veja o que temos.

Outro erro! Leia o que está acontecendo agora:

![Erro na view](https://3247039774-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LOpS81i94i6PF_QDwfr%2F-LOxHNRaKz37xywie2Hh%2F-LOrvmXohk06ZgYVD4w2%2Ftemplate_does_not_exist.png?generation=1539700268355314\&alt=media)

Esta é fácil: *TemplateDoesNotExist*. Vamos corrigir este bug e criar um modelo no próximo capítulo!

> Aprenda mais sobre as views do Django lendo a documentação oficial: <https://docs.djangoproject.com/en/1.8/topics/http/views/>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://afropython.gitbook.io/tutorial/views/blog_views_py.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
