1from django.views.generic import (
2 CreateView,
3 ListView,
4 DetailView,
5 UpdateView,
6 DeleteView,
7 TemplateView,
8)
1from django.shortcuts import render
2from django.http import HttpResponse
3# Create your views here.
4def hola(request):
5 return HttpResponse("Hola Mundo, Esto es Django")
1from django.http import HttpResponse
2import datetime
3
4def current_datetime(request):
5 now = datetime.datetime.now()
6 html = "<html><body>It is now %s.</body></html>" % now
7 return HttpResponse(html)
1# views.py
2from django.views.generic import ListView
3from books.models import Publisher
4
5class PublisherListView(ListView):
6 model = Publisher
7
1# some_app/views.py
2from django.views.generic import TemplateView
3
4class AboutView(TemplateView):
5 template_name = "about.html"
6