django 常见错误汇总

本文介绍了解决Python中出现的SyntaxError错误的方法,特别是关于Unicode解码问题,并提供了如何处理未应用的数据库迁移的步骤。
 File "D:\python\django\mysite\mysite\view.py", line 7
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa3 in position 0:
 invalid start byte
1、SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa3 in position 0:
 invalid start byte
可能原因:1、编辑器的编码格式有问题,比如notepad++,右下角可以看到编码格式
我的就是ANSI,但是python默认都是utf-8的,所以可以‘格式’-‘以utf-8格式编码’即可

2、
You have 14 unapplied migration(s). Your project may not work properly until you

apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
January 28, 2018 - 11:51:04
Django version 2.0.1, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8001/
Quit the server with CTRL-BREAK.


 好吧,运行python manage.py migrate 搞定

 

转载于:https://www.cnblogs.com/duole/p/8370902.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值