django错误
墨飏韶年
leetcode:https://leetcode-cn.com/problemset/all/
展开
-
django.db.utils.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password:
Django错误又来了,数据库的连接问题。。。。。。。。。出现django.db.utils.OperationalError: (1045, "Access denied for user ‘root‘@‘localhost‘ (using password: YES)"),说明自己设置的密码错误,在setting.py中改即可。就是图中涂抹的位置,改为自己数据库的密码...原创 2018-06-28 14:56:51 · 12510 阅读 · 2 评论 -
解决python - ImportError: No module named crispy-forms
I'm working on some django apps, pretty noob still. Would like to use crispy-forms, but eclipse and django doesnt recognize it.Trying to runserver or shell:$ python manage.py runserverthis happens:Tr...原创 2018-07-04 10:11:01 · 5148 阅读 · 0 评论 -
解决TypeError: __init__() missing 1 required positional argument: 'on_delete'
源码如下:from django.db import models# Create your models here.class Question(models.Model): question_text = models.CharField(max_length=200) put_date = models.DateTimeField("data publi...原创 2018-07-11 16:04:33 · 9369 阅读 · 0 评论 -
django 登陆后自动跳到:/accounts/profile/ 怎么修改跳到首页?
Django auth 登陆后页面跳转至/account/profile,修改跳转至其他页面这几天在学习django,django功能很强大,自带的auth,基本可以满足用户注册登陆登出,简单的用户注册登陆系统使用django auth足矣。当然也不是拿来就能用的,需要自己写登陆页面的模板,也很简单。自己尝试了一下,发现一个问题,当验证登陆成功后,页面会自动跳转到/account/profil...原创 2018-07-23 17:07:07 · 1851 阅读 · 1 评论 -
ImportError: No module named 'bson.json_util'
当from bson.json_util import dumps的时候,抛出一个导入错误,没有这个模块,后来查看了一下,它需要依赖pymongo这个库,所以先安装了一下这个库,就可以了 ...原创 2018-08-01 10:33:41 · 5324 阅读 · 0 评论 -
Django运行时报出的警告while time zone support is active
RuntimeWarning: DateTimeField Customer.updated received a naive datetime (2016-06-19 07:18:21.118000) while time zone support is active这是一个跟时区有关的问题,错误里说到datetime字段得到一个naive datetime,而不是支持time zone的a...转载 2018-08-01 17:57:18 · 3560 阅读 · 0 评论 -
Django在根据models生成数据库表时报 __init__() missing 1 required positional argument: 'on_delete'
code: 1 #encoding=utf-8 2 from django.db import models 3 # Create your models here. 4 class BookInfo(models.Model): #创建书本信息类,继承models.Model 5 booktitle=models.CharField(max_length=20) ...原创 2018-08-15 10:40:59 · 114 阅读 · 0 评论