Decorator

    [pinterest clone (24)] profileapp update view

    1 views.py class ProfileUpdateView(UpdateView): model = Profile context_object_name = 'target_profile' form_class = ProfileCreationForm success_url = reverse_lazy('accountapp:hello_world') template_name = 'profileapp/update.html' 2 urls.py from django.urls import path from profileapp.views import ProfileCreateView, ProfileUpdateView app_name = 'profileapp' urlpatterns = [ path('create/', Profile..

    [pinterest clone (20)] Authentication

    views.py - def hello_world def hello_world(request): if request.user.is_authenticated: if request.method == "POST": temp = request.POST.get('hello_world_input') new_hello_world = HelloWorld() new_hello_world.text = temp new_hello_world.save() return HttpResponseRedirect(reverse('accountapp:hello_world')) else: hello_world_list = HelloWorld.objects.all() return render(request, 'accountapp/hello_w..