Fix datagrid pagination on Django 1.5.

Django 1.5 didn't like how we were attempting to access a variable in
the context that didn't exist, and would fail with a traceback.

We now guarantee that these variables always exist.