Answers for "django reverse"

3

django reverse

from django.urls import reverse

def myview(request):
    return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
Posted by: Guest on October-09-2020
1

django httpresponseredirect reverse app url

def get_success_url(self):
    messages.success(self.request, 'Profile Updated Successfully')
    return reverse('accounts:profile')
Posted by: Guest on March-30-2020
-1

django reverse lazy

class NewJobCBV(LoginRequiredMixin, CreateView):
    template_name = 'company/job.html'
    form_class = newJobForm
    # success_url = reverse_lazy('newJob')

    def get_success_url(self, **kwargs):
        return reverse("newJob")
Posted by: Guest on November-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language