Django 注册 Registration_form
Django Registration Registration_form
我正在使用 Django Registration_redux 模板进行用户注册。
我想知道当用户提交他的注册时 Django 是如何知道去哪里的,当 action 是 action="." ?
{% 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 %}
如果您的操作为空白或 .
,则 post 会转到呈现表单的视图 (URL)。
这是一个使用联系表单的简单示例; https://hellowebapp.com/news/tutorial-setting-up-a-contact-form-with-django/
我正在使用 Django Registration_redux 模板进行用户注册。 我想知道当用户提交他的注册时 Django 是如何知道去哪里的,当 action 是 action="." ?
{% 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 %}
如果您的操作为空白或 .
,则 post 会转到呈现表单的视图 (URL)。
这是一个使用联系表单的简单示例; https://hellowebapp.com/news/tutorial-setting-up-a-contact-form-with-django/