Django terbalik
from django.urls import reverse
def myview(request):
return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
Clean Cowfish
from django.urls import reverse
def myview(request):
return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
reverse('edit_project', kwargs={'project_id':4})
response = self.client.get('%s?param1=%s' % (reverse('url'), 'param1_value'))
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")