// views.py
class SomeFormView(FormView):
def get_success_url(self):
if 'ka' in self.request.get_full_path():
success_url = '/ka/message-sent/'
elif 'en' in self.request.get_full_path():
success_url = '/en/message-sent/'
else:
success_url = '/message-sent/'
return success_url
// template.html
<form action="{% url 'app_name:message-sent' %}">
{% csrf_token %}
{{ form }}
</form>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter