![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
django
Black leaves
莫等闲
展开
-
文件上传时raise MultiValueDictKeyError(key)
head_img = models.ImageField(upload_to="head/%Y%m/%d", null=True, default="head/default.png", verbose_name="头像")上传的是"1.jpg", 根据models的head_img, 我上传后的文件路径应该是upload_to+文件名查看request.POST中是有传入文件的, 但是request.POST[“head_img”] 或者request.POST.get(“head_img”...原创 2020-08-12 12:55:21 · 616 阅读 · 0 评论 -
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa6 in position 9737: illegal multibyte sequence
如下报错 File "E:\virtual\supermarket\lib\site-packages\django\views\debug.py", line 94, in technical_500_response html = reporter.get_traceback_html() File "E:\virtual\supermarket\lib\site-packages\django\views\debug.py", line 332, in get_traceback_ht原创 2020-07-30 18:11:23 · 765 阅读 · 0 评论 -
解决Django出现OverflowError: Python int too large to convert to C long
File "C:\Users\huaixiao\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "C:\Users\huaixiao\AppData\Local\Programs\Python\Python37-32\lib\sit..原创 2020-07-16 13:57:06 · 1417 阅读 · 0 评论 -
解决django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing
django.core.exceptions.ImproperlyConfigured: Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.出错代码原创 2020-07-11 09:44:48 · 529 阅读 · 1 评论