我正在使用Django Registration_redux模板进行用户注册。我想知道当用户提交注册时,当操作是action=".“时,Django如何知道去哪里?
{% extends "registration/registration_base.html" %}
{% load i18n %}
{% block title %}{% trans "Register for an account" %}{% endblock %}
{% block content %}
<form method="post" action="">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans 'Submit' %}" />
</form>
{% endblock %}
{% comment %}
**registration/registration_form.html**
Used to show the form users will fill out to register. By default, has
the following context:
``form``
The registration form. This will be an instance of some subclass
of ``django.forms.Form``; consult `Django's forms documentation
<http://docs.djangoproject.com/en/dev/topics/forms/>`_ for
information on how to display this in a template.
{% endcomment %}发布于 2017-02-13 09:50:05
如果您的操作为空或.,那么post将转到呈现表单的视图(URL)。
下面是一个使用联系人表单的简单示例;https://hellowebapp.com/news/tutorial-setting-up-a-contact-form-with-django/
https://stackoverflow.com/questions/42195432
复制相似问题