Django新版本报错问题解决

在创建app的时候会报如下错误:

python3 manage.py startapp test

django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).

这是因为启动app的时候会检测当前的SQLite的版本,如果低于3.9.0就会报错,如果不准备用SQLite的话,可以修改代码,如下:

vi /usr/local/python3/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py

# 找到如下代码段:
def check_sqlite_version():
    if Database.sqlite_version_info < (3, 9, 0):
        raise ImproperlyConfigured(
            'SQLite 3.9.0 or later is required (found %s).' % Database.sqlite_version
        )

# 修改为:
def check_sqlite_version():
    if Database.sqlite_version_info < (3, 6, 3):
        raise ImproperlyConfigured(
            'SQLite 3.9.0 or later is required (found %s).' % Database.sqlite_version
        )

  

posted on 2022-07-07 16:55  torotoise512  阅读(431)  评论(0编辑  收藏  举报