【问题标题】:"django.core.exceptions.ImproperlyConfigured:" while doing migrations to posgreSQL\"django.core.exceptions.ImproperlyConfigured:\" 迁移到 postgreSQL
【发布时间】:2022-11-02 12:15:59
【问题描述】:

我在 models.py 中创建了一个表,还在 settings.py 中添加了与我的 PostgreSQL 数据库的连接。但是当我在命令提示符下进行迁移时,我得到了这些错误

`

django.core.exceptions.ImproperlyConfigured: 'django.db.backends.posgresql' isn't an available database backend or couldn't be imported. Check the above exception. To use one of the built-in backends, use 'django.db.backends.XXX', where XXX is one of:
    'mysql', 'oracle', 'postgresql', 'sqlite3'

`

我已经通过命令提示符安装了 Django,但我仍然不知道为什么会出现这些错误。我期待我的表成功迁移到 PostgreSQL 数据库。

【问题讨论】:

    标签: python django postgresql


    【解决方案1】:

    这是一个常见的错误

    'django.db.backends.posgresql'
    

    你在这里打错字了。忘记在 postgresql 中添加 't'

    'django.db.backends.postgresql'
    

    这应该修复错误

    【讨论】:

      【解决方案2】:

      这是由于编写时的拼写错误造成的:

      django.db.backends.posgresql
      

      你忘了把信 t 所以:

      django.db.backends.postgresql
      

      【讨论】:

        【解决方案3】:

        你这里有错字。修复它,问题就会解决

        【讨论】:

          【解决方案4】:

          这是由于编写时的拼写错误造成的:

          django.db.backends.posgresql
          

          你忘了把字母 t 写成这样:

          django.db.backends.postgresql
          

          【讨论】:

            【解决方案5】:

            DATABASES 内部,您的ENGINE 中有一个typo 错误。它必须是django.db.backends.postgresql

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 2011-06-13
              • 2016-08-13
              • 2016-08-22
              • 2018-02-05
              • 2017-04-28
              • 1970-01-01
              • 2022-12-12
              • 2011-02-22
              相关资源
              最近更新 更多