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.