1234567891011121314151617 |
- from django.http import HttpResponse
- from django.shortcuts import render
- import time
- from django.utils import timezone
- from datetime import timedelta
- from polls.models import Notice
-
- def index(request):
- context = {'now' : time.strftime('%H:%M:%S', time.localtime()),
- 'posts' : Notice.objects.all() }
- # start = timezone.now()
- #end = start + timedelta(days=10)
- #for n in Notice.objects.all():
- # print(n.notice_title)
- return render(request, 'polls/index.html', context)
-
- # Create your views here.
|