我在mongoengine中使用django1.6。在
我刚开始尝试简单的验证码,但我有以下错误。在
正如http://django-simple-captcha.readthedocs.org/en/latest/usage.html中所说
我在我的env中安装,添加到已安装的应用程序中,我没有运行syncdb,因为我使用MongoDB,这是不必要的,最后我添加了url(r“^captcha/”,include('验证码.url')),放入我的url应用程序文件中。在
我的表单.py看起来像:
from django import forms
from captcha.fields import CaptchaField
class PostForm(forms.Form):
user = forms.CharField(max_length=256)
password = forms.CharField(widget=forms.PasswordInput)
email = forms.CharField(max_length=256)
captcha = CaptchaField()
我的观点是:
^{pr2}$因此,当表单呈现时,它给了我一个错误:
AttributeError at /game/form_upload.html
'DatabaseWrapper' object has no attribute 'Database'
In template /.../post_form_upload.html, error at line 2
'DatabaseWrapper' object has no attribute 'Database'
1 <form action='/game/form_upload.html' method='post'>{% csrf_token %}
2 {{ form.as_p }} <- HERE
3 <input type='submit' value='Submit' />
4 </form>
5
怎么了表格as\p? 没有这个验证码就没问题了。在
目前没有回答
相关问题 更多 >
编程相关推荐