Template view not changing

In my custom app, I have put two files item_view.py and item_view.html at the location frappe-bench/apps/myapp/myapp/templates/pages/

Content of item_view.py file:
> from __future__ import unicode_literals
> import frappe
> def get_context(context):
>     context.items = frappe.db.sql("select * from `tabItem`", as_dict=T)
Content of item_view.html file:
{% extends "templates/web.html" %}
{% block content %}
    Hello
    <h3>Items</h3>
    <table>
    <thead>
        <th>Name</th>
        <th>Length</th>
        <td>Width</td>
    </thead>
    <tbody>
    {% for ins in items %}
    <tr>
        <td>{{ ins["name"] }}</td> 
        <td>{{ ins["length_in"] }}</td>
        <td>{{ ins["length_cm"] }}</td>
    </tr>
    {% endfor %}
    </tbody>
    </table>
{% endblock %}

Previously the contents of the item_view.html file was :slight_smile:

{% extends "templates/web.html" %}
{% block content %}
    Hello
    <h3>Items</h3>
    <ul>
    {% for ins in items %}
        <li>{{ ins["name"] }}</li>
    {% endfor %}
    </ul>
{% endblock %} 

Now once those files are uploaded, The view on the website does not change on altering the item_view.html file. It is still showing the previous output. Is this cache problem?

Yeah, pages are cached by default in your item_view.py add

context.no_cache = True
2 Likes