How to add new page in Django admin site, with custom context data?
<p>I want to provide a new admin page, where admin user can update some model.</p>

<p>As of now, I have provided custom url under admin section and in view  verified wether the user is superuser, and returned my html template.</p>

<p>While returning template I am passing some data with context object, a list of model query result. All pages and structure are loading fine, but the data I provided through context variable is available when accessing it in the template.</p>

<p>Following is the code structure I have :</p>

<p>admin URL:</p>

<pre><code>admin/add-product-details
</code></pre>

<p>view listening to this call:</p>

<pre><code>@user_passes_test(lambda u: u.is_superuser)
def add_product_details(request):
    products = Product.objects.all()
    context = {
        products : products
    }
    return render_to_response('admin/add_product_details.html',context,context_instance = RequestContext(request))
</code></pre>

<p>Tempalte structure:</p>

<pre><code>{% extends "admin/base.html" %}

{% block content_title %}
    &lt;h3&gt;
        &lt;small&gt;
            ADD PRODUCT DETAILS
        &lt;/small&gt;
    &lt;/h3&gt;
{% endblock %}

{% block content %}
    &lt;div class="container"&gt;
        &lt;div class="row"&gt;
            &lt;hr&gt;
            {{products}}
            &lt;hr&gt;
            &lt;select&gt;
                &lt;option value=""&gt;Select Product&lt;/option&gt;
                {% for product in products %}
                    &lt;option value="{{product.id}}"&gt;
                        {{product.id}} - {{product.name}}
                    &lt;/option&gt;
                {% endfor %}
            &lt;/select&gt;
        &lt;/div&gt;
    &lt;/div&gt;
{% endblock %}
</code></pre>