Create a New Page
Last Updated: June 2025
This recipe will show you how to add additional pages to your Tethys app. You may need to create a new page to display various types of data, include explanatory text, or have a home page separate from a map viewer.
Create a new
templates/new_app/new_page.htmlwith the following contents:
{% extends tethys_app.package|add:"/base.html" %}
{% load static tethys %}
{% block app_content %}
<h1>Welcome to your brand new page</h1>
{% endblock %}
Create a new
new_pagecontroller incontrollers.py:
from tethys_sdk.routing import controller
@controller(name='new_page', url='new_page')
def new_page(request):
"""
Controller for the app home page.
"""
context = {}
return App.render(request, 'new_page.html', context)
Navigate to http://localhost:8000/apps/new_app/new_page/ and verify that the new page loads with text "Welcome to your brand new page".
Tip
For more details on navigating between pages in your app see the Add Navigation Buttons Recipe recipe and App Templating API.
For more details templating a new page see the App Templating API.