Im using django 1.9 and python 3.5 which i'm both really new too, and i'm having trouble populating a bootstrap dropdown which is located in the base.html. 
So far i have this:

base.html:

```
<li class="dropdown">
       <a href="#" class="dropdown-toggle" data-toggle="dropdown">Events
       <b class="caret"></b></a>
           <ul class="dropdown-menu">
               {% if categories %}
                   {% for cat in category %}
                       <li><a href="{% url 'categories' pk=cat.pk %}">
                       {{ cat.name }}</a></li>
                   {% endfor %}
               {% else %}
                       There are no categories present.
               {% endif %}
           </ul>
</li>

```

views.py:

```
def categories(request, pk):
    category = Category.objects.get(pk=pk)
    return render(request, 'categories.html', {'category': category})

```

urls.py:

```
url(r'^categories/(?P<pk>\d+)/$', views.categories, name='categories'),

```

So i want the drop down to display the available categories from the database and then when i click on one it will obviously load up the categories.html displaying the relevant category.

any help would be much appreciated.

Edit: sorry i forgot to say the problem i am having. 
Im not getting the drop down populated, and is only giving me the "there is no categories present"