I have a Django application that has been working just fine. Then I get errors on some updates. They are all of the form:
no such table: main.event_contestant__old
My environment is Python 3.7.2, Django 2.1.5 on MacOs 10.12.6
After a couple of days searching around, this appears to be a bug caused by some incompatibility between Django and sqlite3 V2.6 (v3.26).
I have tried Django versions 2.0.7, 2.1.5 and 2.1.7 but the errors persist so, whatever was done in Django 2.1.5 that was supposed to fix the bug is not effective.
Further reading indicates that the bug arrived with sqlite 2.6.0 and that older versions of python used an older version of sqlite3. So I changed my python version to 3.5 but the version of sqlite has not changed.
My question is - why does the sqlite version not change when I use a different version of python?
UPDATE:
Install python 3.5.4 from python.org
Create a virtual environment for python 3.5.4 and run this
Python 3.5.4 (v3.5.4:3f56838976, Aug 7 2017, 12:56:33)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.8.11'
>>>
Do the same for python 3.6.5:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.22.0'
>>>
Once more with python 3.7.2 to get
Python 3.7.2 (v3.7.2:9a3ffc0492, Dec 24 2018, 02:44:43)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.22.0'
>>>
OK. It looks like I have togo back to python 3.5.4 to get a different version of sqlite3 but the actual version is indeed changing with different Python installs.
Now I need to test those versions agains my bug in Django.
I have answered my question below to indicate this update. Probably, I will be back with questions about the Django thing.