23👍
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:
Edit: As of Python 3.9, the official Python installer on Windows already includes the JSON1 extension by default. Upgrade your python version to solve this issue.
For Python 3.8 and below:
- Check your python installation – is it 32bit or 64bit? run:
python -c "import platform;print(platform.architecture()[0])"
- Download the precompiled DLL that matches your Python installation (32-bit or 64-bit).
- Locate your Python installation. By default, it should be in
%localappdata%\Programs\Python\PythonXX
, where XX is the Python version. For example, it’s located inC:\Users\<username>\AppData\Local\Programs\Python\Python37
. If you added Python installation directory to your PATH environment variable, you can run the commandwhere python
on a command prompt to locate it.
Enter the DLLs directory in your Python installation. - Rename (or delete)
sqlite3.dll
inside theDLLs
directory. - Extract
sqlite3.dll
from the downloaded DLL archive and put it in theDLLs
directory. - Now, the JSON1 extension should be ready to be used in Python and Django.
👤Udi
0👍
I had same problem while trying to apply migrations of django-allauth module; and switching to new version of Python solved it.
According to Django site, version should be 3.9+.
https://code.djangoproject.com/wiki/JSON1Extension
- Django, difference between _base_manager and objects
- Pytest and Django settings runtime changes
- Centering and aligning width of figcaption tag on image in figure tag
- Deleting/Clearing django.contrib.messages
Source:stackexchange.com