Django xadmin实战练习
作者:互联网
1.render() missing 1 required positional argument: ‘template_name’
多打了一个括号:
2.‘WSGIRequest’ object has no attribute ‘get’
将
改为user_login_form = UserLoginForm(request.POST)
3.数据迁移
python manage.py makemigrations
python manage.py migrate
4.python smtplib.SMTPAuthenticationError: (535, b’Error: authentication failed’)
这里使用的163邮箱发送邮件,163邮箱开启POP3/SMTP服务,设置客户端授权码,用授权码替代密码即可成功发送邮件
5.django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 9: ‘static’. Did you forget to register or load this tag?
在html文件头部加上 {% load staticfiles %},成功运行
6.too many values to unpack (expected 2)
user_list = UserProfile.objects.filter(email=email)
7.Iterable over raw text documents expected, string object received.
content= [content]
标签:实战,load,xadmin,python,manage,Django,content,template,email 来源: https://blog.csdn.net/Happy_change/article/details/114300712