Yoo - this is a known problem. <https://code.djangoproject.com/ticket/30313> It 
has nothing to do with running "migrate", being in a virtual environment, 
or settings.py. 

Jani - I tried compiling the latest Python manually - it was actually super 
easy - but even with the latest Python, importing _sqlite3 and checking the 
version, I still see the old version. I don't think sqlite is built into 
Python anymore - I think sqlite is some sort of library that Python uses. 
It seems not to be /usr/bin/sqlite3. I think that's just the binary that 
lets you interact with an sqlite database in the terminal - not the library.

There's an article here 
<https://charlesleifer.com/blog/compiling-sqlite-for-use-with-python-applications/>
 
that tries to cover updating sqlite so your Python picks up on it, but so 
far, I haven't had any luck getting it to work.


On Thursday, July 18, 2019 at 1:14:42 AM UTC-6, Jani Tiainen wrote:
>
> Hi.
>
> I think Python has built in version so you might need to build custom 
> version of python.
>
> Pyenv is pretty neat tool to handle custom python builds.
>
> ke 17. heinäk. 2019 klo 21.36 Tal <tal...@gmail.com <javascript:>> 
> kirjoitti:
>
>> Or is Python's sqlite built into Python, not depending on 
>> /usr/bin/sqlite3 at all?
>> Would I have to recompile Python for a newer version of sqlite that 
>> django can use?
>>
>> PS. I know I can downgrade django. I'm wondering how complex it is to 
>> compile a new version of sqlite for it to use.
>>
>> On Wednesday, July 17, 2019 at 12:14:54 PM UTC-6, Tal wrote:
>>>
>>> When using the latest django from PyPI in CentOS 7, running "./manage.py 
>>> runserver" gives an error about sqlite being too old.
>>> Since there's no newer sqlite version in the CentOS repos, I tried 
>>> building sqlite from scratch:
>>>
>>> curl -L https://www.sqlite.org/2019/sqlite-amalgamation-3290000.tar.gz 
>>> > sqlite-amalgamation-3290000.tar.gz
>>> tar -xvf sqlite-amalgamation-3290000.tar.gzcd sqlite-autoconf-3290000
>>> ./configure
>>> make
>>> make install
>>>
>>>
>>> This sets up the latest sqlite3 to /usr/local/bin/.
>>> Since /usr/local/bin is ahead of /usr/bin in my PATH, just running 
>>> "sqlite3" in the terminal runs the latest sqlite.
>>> It runs without issues, and shows that it's the latest version:
>>>
>>> my_hostname# sqlite3
>>>
>>> SQLite version 3.29.0 2019-07-10 17:32:03 
>>> Enter ".help" for usage hints. 
>>> Connected to a transient in-memory database. 
>>> Use ".open FILENAME" to reopen on a persistent database. 
>>> sqlite>
>>>
>>>
>>> Running "./manage.py runserver" again, it still tries to use the old 
>>> version in /usr/bin, and fails.
>>> My django is running in a pipenv virtual environment, where PATH still 
>>> has /usr/local/bin/ ahead of /usr/bin, and running "sqlite3" in terminal 
>>> still shows the latest version.
>>>
>>> I followed the traceback django gives me to the dbapi2.py module, where 
>>> to figure out the sqlite version it does this:
>>>
>>> import _sqlite3
>>> _sqlite3.sqlite_version
>>>
>>>
>>> If I run "python" in my virtualenv, and type those 2 lines, it shows the 
>>> old version of sqlite too.
>>> _sqlite3 is not written in python - it's a compiled binary, so I can't 
>>> examine it to see where it looks.
>>>
>>> Am I missing something?
>>> How can I tell _sqlite3 that there's a newer version of sqlite available 
>>> on the system?
>>> Does _sqlite3 even care about /usr/local/bin/sqlite3? Or is there some 
>>> sqlite library it's looking for?
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/3d011ce9-c849-48a7-82be-0ea08edb4566%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/3d011ce9-c849-48a7-82be-0ea08edb4566%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/589b6a4a-c27f-4128-ba1d-f98f24d35eae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to