【发布时间】:2011-11-22 11:37:59
【问题描述】:
我正在尝试使用 Django 发布一些非常基本的表单帖子,但是每当我尝试单击按钮提交信息时,什么都没有发生。终端或 Chrome 的开发人员中不会显示任何类型的错误或消息。这个页面没有JS,只是直接的html:
<form method="post" action="/">
{% csrf_token %}
<input type="text" id="name" name="name"/>
<input type="text" id="password" name="password"/>
<input type="button" value="Sign Up!"/>
</form>
我对这个页面的看法也很简单:
def sign_up(request):
return render_to_response('portal/signup.html', context_instance=RequestContext(request))
我真的很困惑发生了什么,我一直在关注this 来学习身份验证。一切正常,但我认为添加“创建用户”将是下一步。我似乎也无法以任何形式在其他页面上工作。
任何帮助都会很棒,我快疯了!
【问题讨论】:
-
您确定要
action="/"而不是action=""?
标签: django forms authentication post