Django连接现有测试数据库,自动生成modeles模型文件
1、创建一个MyApp:
django-admin.py startapp myApp
2、将测试数据库文件导入到models文件中:
python manage.py inspectdb > myApp/models.py
3、将数据导入models文件后执行报:
SyntaxError: Non-ASCII character '\xff' in file C:/workspace/review/myApp/models.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
即使开头加上#-- coding: UTF-8 --还是报错,看了10多篇博文,热心博主说的方法都试了,还是报错