Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Post List View | Templates
Django: First Dive

Desliza para mostrar el menú

book
Post List View

Now, let's create the post_list.html file inside the template folder.

For now, the HTML file should be the following structure:

html

We implemented the post_list view function:

python

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Tarea

Swipe to start coding

  1. Rewrite the post_list function using the render() function. The render function should:

    • Receive the request as the first argument.
    • Receive the post_list.html template name as the second argument.
    • Receive the context dictionary as the third argument.
  2. The context dictionary should contain the "post" key with the iterable QuerySet of posts.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 3
Lamentamos que algo salió mal. ¿Qué pasó?

Pregunte a AI

expand
ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

book
Post List View

Now, let's create the post_list.html file inside the template folder.

For now, the HTML file should be the following structure:

html

We implemented the post_list view function:

python

Note

The presented code for the task is part of the framework and cannot work separately, so errors will be received when you try to Run Code. Use the Submit Task button to solve this task.

Tarea

Swipe to start coding

  1. Rewrite the post_list function using the render() function. The render function should:

    • Receive the request as the first argument.
    • Receive the post_list.html template name as the second argument.
    • Receive the context dictionary as the third argument.
  2. The context dictionary should contain the "post" key with the iterable QuerySet of posts.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 3
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Lamentamos que algo salió mal. ¿Qué pasó?
some-alt