python manage.py migrate时出现问题

社长大人,本人菜鸟,安装视频操作,python manage.py migrate时总是出现错误代码,麻烦看看,谢谢了。

(tommy) E:\tommy\TT>python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 15, in <module>
execute_from_command_line(sys.argv)
File "E:\tommy\lib\site-packages\django\core\management\__init__.py", line 371
, in execute_from_command_line
utility.execute()
File "E:\tommy\lib\site-packages\django\core\management\__init__.py", line 347
, in execute
django.setup()
File "E:\tommy\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "E:\tommy\lib\site-packages\django\apps\registry.py", line 112, in popula
te
app_config.import_models()
File "E:\tommy\lib\site-packages\django\apps\config.py", line 198, in import_m
odels
self.models_module = import_module(models_module_name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\import
lib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 680, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "E:\tommy\lib\site-packages\django\contrib\auth\models.py", line 2, in <m
odule>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "E:\tommy\lib\site-packages\django\contrib\auth\base_user.py", line 47, i
n <module>
class AbstractBaseUser(models.Model):
File "E:\tommy\lib\site-packages\django\db\models\base.py", line 114, in __new
__
new_class.add_to_class('_meta', Options(meta, app_label))
File "E:\tommy\lib\site-packages\django\db\models\base.py", line 315, in add_t
o_class
value.contribute_to_class(cls, name)
File "E:\tommy\lib\site-packages\django\db\models\options.py", line 205, in co
ntribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length(
))
File "E:\tommy\lib\site-packages\django\db\__init__.py", line 33, in __getattr
__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "E:\tommy\lib\site-packages\django\db\utils.py", line 202, in __getitem__

backend = load_backend(db['ENGINE'])
File "E:\tommy\lib\site-packages\django\db\utils.py", line 110, in load_backen
d
return import_module('%s.base' % backend_name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\import
lib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "E:\tommy\lib\site-packages\django\db\backends\postgresql\base.py", line
20, in <module>
import psycopg2 as Database
File "E:\tommy\lib\site-packages\psycopg2-2.6.2-py3.7-win-amd64.egg\psycopg2\_
_init__.py", line 104
connection_factory=None, cursor_factory=None, async=False, **kwargs):
^
SyntaxError: invalid syntax

2018五月14号 23:53:50 tommyhenry重新编辑了文章
涨见识0 涨水分0

** 文章讲述的内容可能你不赞同,不喜欢,但如果觉得观点新颖,内容独到,提高了你的知识面,帮你了解了你不懂的知识和知道了突发的新闻,这样的贴,希望能点涨见识,相反,到处转载,内容无聊,雷同,毫无建树,请点涨水分!

我要评论

提交评论
每个人都有自己的看法,登录以后马上发表。还没有账号?点击这里马上注册一个账号。

当前有2条评论

  • 繁花社长 :2018五月15号 12:59:35
    这个命令不应该出错啊。看你贴出来的报错信息,最后一行

    SyntaxError: invalid syntax

    语法出错,是不是你的数据库配置没写对

    按道理,同步数据库的命令就那2句
    操作起来出错的话
    要么是django里面的数据模型有问题
    要么你数据库的配置有问题
    你检查下吧
    0 0 回复 举报

需要登录以后才能进行刚才的操作

  • 刚才的操作,需要登录以后才能继续,如果已经有账号,请点击登录,登录以后,会自动返回到当前页面进行刚才的操作。如果还没有账号,请点击注册。