# Create your views here.
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import get_object_or_404, render_to_response, redirect
from django.template.context import RequestContext
from .utils import slug2id
from notifications.models import Notification

@login_required
def list(request):
    """
    Index page for authenticated user
    """
    actions = Notification.objects.filter(recipient=request.user)

    paginator = Paginator(actions, 16) # Show 16 notifications per page
    page = request.GET.get('p')

    try:
        action_list = paginator.page(page)
    except PageNotAnInteger:
        # If page is not an integer, deliver first page.
        action_list = paginator.page(1)
    except EmptyPage:
        # If page is out of range (e.g. 9999), deliver last page of results.
        action_list = paginator.page(paginator.num_pages)

    return render_to_response('notifications/list.html', {
        'member': request.user,
        'action_list': action_list,
    }, context_instance=RequestContext(request))

@login_required
def read_all(request):
    Notification.objects.mark_all_as_read(request.user)

    return redirect('notifications_list')

@login_required
def read(request, slug=None):
    id = slug2id(slug)

    notification = get_object_or_404(Notification, recipient=request.user, id=id)
    notification.mark_as_read()

    next = request.REQUEST.get('next')

    if next:
        return redirect(next)

    return redirect('notifications_list')

@@ -248,28 +248,16 @@
 , render
-_to_response
 , redire
@@ -404,20 +404,19 @@
 red%0Adef 
-list
+all
 (request
@@ -480,68 +480,170 @@
     
-actions = Notification.objects.filter(recipient=request.user
+return render(request, 'notifications/list.html', %7B%0A        'notifications': request.user.notifications.all()%0A    %7D)%0A    actions = request.user.notifications.all(
 )%0A%0A 
@@ -1081,16 +1081,24 @@
 _pages)%0A
+        
 %0A    ret
@@ -1291,16 +1291,14 @@
 def 
+un
 read
-_all
 (req
@@ -1312,60 +1312,229 @@
     
-Notification.objects.mark_all_as_read(request.user)%0A
+return render(request, 'notifications/list.html', %7B%0A        'notifications': request.user.notifications.unread()%0A    %7D)%0A    %0A@login_required%0Adef mark_all_as_read(request):%0A    request.user.notifications.mark_all_as_read()
 %0A   
@@ -1564,21 +1564,20 @@
 ications
-_list
+:all
 ')%0A%0A@log
@@ -1592,16 +1592,24 @@
 red%0Adef 
+mark_as_
 read(req
@@ -1883,16 +1883,15 @@
 ications
-_list
+:all
 ')%0A

Use urls with namespaces. Use request.user.notifications instead of Notifications.objects... Use render() instead of render_to_response()