Django 初始化数据库遇到问题(python manage.py migrate)

问题:django.db.utils.InternalError: (1049, "Unknown database 'main'")

 在Django 配置的数据库上 执行  create database main  创建 main 数据库

问题:AttributeError: 'str' object has no attribute 'decode'

因为django对python2.x 和3.x支持不一样,在python3.x中需要 注释掉 以下代码(if的两句)

猜你喜欢

转载自www.cnblogs.com/newtom/p/11724581.html