“Django View” Code-Antworten

Django View

from django.http import HttpResponse #last line below allows MyView.get 
# to return an HttpResponse object 
from django.views import View #View is to become the parent class of MyView

class MyView(View):
	''' View is the parent class that provides method as_view() to MyView '''
    def get(self, request, *args, **kwargs):
        return HttpResponse('Hello, World!')
ruperto2770

Django Ansicht erstellen

class AuthorCreateView(CreateView):
    form_class = AuthorForm
    template_name = 'author_new.html'
    success_url = 'success'
omeatai

Ähnliche Antworten wie “Django View”

Fragen ähnlich wie “Django View”

Weitere verwandte Antworten zu “Django View” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen