其他分享
首页 > 其他分享> > Django新版本报错问题解决

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
        )

  

标签:SQLite,本报,Database,required,sqlite,Django,version,新版,3.9
来源: https://www.cnblogs.com/tortoise512/p/16455313.html