I have been stuck on this for a while. I am trying to put both the login and registration forms on the same page, however I have been getting multiple errors depending on which approach I try. The page is actually able to load fine, however neither of the form fields will load. And then when I hit the register or login button (both type submit), I most recently am gettin开发者_开发百科g a csrf related error. Any suggestions on how to implement both forms on the same page would be greatly appreciated.
I think it might be csrf token not found error.If you are using django 1.3 with csrf middleware you have to put csrf token {% csrf_token %} tag with each form posting data like this:
{% extends "admin/base.html" %}
{% load i18n %}
{% block content %}
<form method="post" action=".">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans 'Submit' %}" />
</form>
{% endblock %}
精彩评论