Udi*_*Udi 5 sqlite django jsonfield django-3.1
I have created a Django project with the new JSONField announced in Django 3.1, which supports all databases.
I have successfully used this field on a linux machine, but running python manage.py migrate with the same project on Windows fails with the following message:
(fields.E180) SQLite does not support JSONFields.
Run Code Online (Sandbox Code Playgroud)
The same versions of Python and Django are used in both PCs.
Udi*_*Udi 12
For using JSONField with Django 3.1+ and sqlite, the JSON1 sqlite extension must be installed.
To enable JSON1 on sqlite follow the instructions on Django's wiki: https://code.djangoproject.com/wiki/JSON1Extension.
Instructions for Windows:
python -c "import platform;print(platform.architecture()[0])"%localappdata%\Programs\Python\PythonXX,其中 XX 是 Python 版本。例如,它位于C:\Users\<username>\AppData\Local\Programs\Python\Python37. 如果您将 Python 安装目录添加到 PATH 环境变量中,则可以where python在命令提示符下运行该命令来定位它。在 Python 安装中输入 DLLs 目录。sqlite3.dll在DLLs目录内重命名(或删除)。sqlite3.dll从下载的 DLL 存档中提取并将其放入DLLs目录中。| 归档时间: |
|
| 查看次数: |
5410 次 |
| 最近记录: |