How to create a Web Framework page template using Django Bindings

Django Bindings has been deprecated. For more, see the Deprecation Notice.

To add pages to your app, you'll need to add a template for each page.

  1. Create a new file with the .html extension in the $SPLUNK_HOME/etc/apps/your_app_name/django/your_app_name/templates/ directory.
  2. Open the HTML file in a text editor and paste in the following boilerplate template text:
  3. {# Boilerplate for a Django Bindings template #}
    {% extends "splunkdj:base_with_app_bar.html" %}
    
    {% load splunkmvc %}
    
    {% block title %}{{app_name}} Your page title goes here{% endblock title %}
    {% block css %}
        <!-- Style sheets are loaded here -->
        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}{{app_name}}/custom.css" />
        <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}splunkjs/css/dashboard.css" />
        <style>
            /* Define any page styles here*/
        </style>
    {% endblock css %}
    {% block content %}
        <!-- You can use HTML and <div> tags for layout -->
        {# Splunk views go here #}
    {% endblock content%}
    
    {% block managers %}
        {# Search managers go here #}
    {% endblock managers %}
    {% block js %}
        {# JavaScript goes here #}
    {% endblock js %}
    
  4. Now you can fill in the details―see the following topics for more information: