13 lines
403 B
Python
13 lines
403 B
Python
from django.http import HttpResponse
|
|
from django.shortcuts import render_to_response
|
|
from django.template import Context, loader
|
|
from main.models import Activity
|
|
|
|
def index(request):
|
|
activity_list = Activity.objects.all().order_by("-date")[:5]
|
|
t = loader.get_template("home.html")
|
|
c = Context({
|
|
"activitylist": activity_list,
|
|
})
|
|
|
|
return HttpResponse(t.render(c))
|