You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

views.py 523B

12345678910111213141516
  1. from django.shortcuts import render
  2. from django.utils import timezone
  3. from posts.models import Notice
  4. # Create your views here.
  5. def index(request):
  6. notices = Notice.objects.all()
  7. notices = notices.filter(pub_start__lte=timezone.now())
  8. notices = notices.filter(pub_end__gte=timezone.now())
  9. return render(request, 'posts/notice.html', {'allnotice': notices})
  10. def welcome_seite(request):
  11. return render(request, 'posts/index.html')
  12. def about_seite(request):
  13. return render(request, 'posts/about.html')