![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Django
小孩不能抽烟
这个作者很懒,什么都没留下…
展开
-
Django将数据库设置成mysql
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': '', 'USER':'root', 'PASSWORD':'', 'HOST':'localhost', 'PORT':'3306', } ...原创 2018-07-03 10:41:34 · 272 阅读 · 0 评论 -
django admin报错IntegrityError:'Cannot add or update a child row: a foreign key constraint fails'
如果在使用Django Admin后台添加用户时出现报错 (1452, 'Cannot add or update a child row: a foreign key constraint fails (`mxproject`.`django_admin_log`, CONSTRAINT `django_admin_log_user_id_c564eba6_fk_auth_user_id` ...转载 2018-08-13 20:16:43 · 456 阅读 · 0 评论 -
Django的xadmin的错误
当django2.0使用xadmin点击用户出现render() got an unexpected keyword argument 'renderer'错误 修改xadmin下的boundfield.py中的def as_widget方法 89行: 源代码如下 return widget.render( name=self.html_initial_name if only_...转载 2018-08-23 11:39:00 · 477 阅读 · 0 评论 -
django自定义auth的方法
在settings里面设置 AUTHENTICATION_BACKENDS = ( 'users.views.CustomBackend', ) 然后在user模块的登录页面设置 class CustomBackend(ModelBackend): def authenticate(self, request, username=None, password=None, ...原创 2018-09-05 20:42:49 · 552 阅读 · 1 评论