Mohamed Feddad

57%
Flag icon
from django.urls import reverse_lazy   class GenericFormView(generic.FormView):     template_name = 'form.html'     form_class = PersonDetailsForm     success_url = reverse_lazy("success") We need to use reverse_lazy in this case because the URL patterns are not loaded when the View file is imported.
Mohamed Feddad
Creating DRY abstracted form view
Django Design Patterns and Best Practices: Industry-standard web development techniques and solutions using Python, 2nd Edition
Rate this book
Clear rating