I have a FormView where I do some stuff after submitting the form and then I want to redirect to a stripe checkout. Is it possible without Javascript?
class ApplicationForm(forms.ModelForm):
class Meta:
model = Application
fields = "email", "name"
def save(self, commit=True):
application = super().save(commit=commit)
checkout_session = stripe.checkout.Session.create(...) # I'm creating the session here and do some other stuff with the form input
return application
class ApplicationView(CreateView):
template_name = "application.html"
form_class = ApplicationForm
def get_success_url(self):
# TODO: How do I redirect to Stripe checkout here?