![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Django
wang_yq123
这个作者很懒,什么都没留下…
展开
-
django报错:add_atr() takes 0 positional arguments but 1 was given
TypeError at /add_stu/add_stu() takes 0 positional arguments but 1 was givenRequest Method: GETRequest URL: http://127.0.0.1:8000/add_stu/Django Version: 3.0.3Exception Type: TypeErrorException ...原创 2020-03-01 10:41:42 · 738 阅读 · 0 评论 -
raise ImproperlyConfigured'mysqlclient 1.3.13
解决方案第一步:点击报错位置找到这两行 注释掉version = Database.version_infoif version < (1, 3, 13):raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.’ % Database.version)第二步再次执行pyth...原创 2020-02-24 00:17:00 · 233 阅读 · 0 评论 -
list indices must be integers or slices, not str
原代码:def register(request): if request.method == 'GET': return render(request, 'register.html') if request.method == 'POST': form = UserRegisterForm(request.POST) if fo...原创 2019-03-24 18:22:45 · 2639 阅读 · 0 评论 -
render() missing 1 required positional argument: 'template_name'
render() missing 1 required positional argument: ‘template_name’原创 2019-03-23 15:51:55 · 7474 阅读 · 0 评论 -
Django内置user模型中使用的方法详解
1.Login_required 装饰器一般网站的登录功能,都会涉及到以下需求:用户登陆系统才可以访问某些页面如果用户没有登陆而直接访问就会跳转到登陆界面,而不能访问其他页面。用户在跳转的登陆界面中完成登陆后,自动访问跳转到之前访问的地址要实现这样的需求其实很简单:使用django自带的装饰器 @login_required。在相应的view方法的前面添加@login_req...原创 2019-03-26 20:56:13 · 659 阅读 · 0 评论 -
待解决问题:TypeError: __init__() got an unexpected keyword argument 'max_length'
1.由于在导入Django模型( phone = models.IntegerField(max_length=15, unique=True, null=False))时,报如下警告:2.在做页面手机号长度限制时,报错:TypeError: init() got an unexpected keyword argument ‘max_length’: mobile = forms...原创 2019-03-24 16:59:23 · 7488 阅读 · 1 评论