UNC BACS 350

Web Apps with Python/Django

Logo

Lesson 22 -  View Layout

LEARN

Django for Beginners - Chapter 10 - Bootstrap

Today

W3Schools

Reusable Views

Refactoring

Building a Theme Template

Blocks

theme.html

```html

{% block content %}

No body content given

{% endblock content %} ```

list.html

```html {% extends 'theme.html' %}

{% block content %}

{% for account in object_list %} {% endfor %}
{{ account.first_name }} {{ account.last_name }} {{ account.email }}
{% endblock content %} ```

Includes & Partial templates

theme.html

```html

{% include 'user_info.html' %}

{% block content %}
{% endblock content %}

```

user_info.html

```html

```

Navbar, Header, Main, Footer

container, col, card

BUILD

Demo Code for Reuse

Refactoring