django 常见错误汇总

 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 搞定

 
posted @ 2018-01-28 12:20  御剑之道  阅读(198)  评论(0编辑  收藏  举报