I am moving my Django code from 2.1.7 directly to the new Django 2.2. The only problem I encountered in my Centos7 development environment was that my local development database (sqlite3) version was incompatible using my Python 3.6.7.
The error I was getting from "manage.py runserver" was:
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later
I am unable to use another version of Python because this is the maximum supported by AWS elasticbeanstalk. The Python 3.6.7 seems to come with sqlite module of version:
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.7.17'
>>>
I use a seperate development account on my local Centos7 workstation and issue pipenv shell to begin my code development and IDE.
The only workaround I've found is to manually download SQLite3 autoconf version 3.27.2 and manually compile into that development account home folder using the following commands:
wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz
gzip -d sqlite-autoconf-3270200.tar.gz
tar -xvf sqlite-autoconf-3270200.tar
cd sqlite-autoconf-3270200/
./configure --prefix=/home/devuser/opt/
make
make install
Following that, I have modified my .bashrc to reflect the following:
export LD_LIBRARY_PATH="${HOME}/opt/lib"
This seems to do the trick when I log back into my devuser account. My app seems to run correctly using my local development database.
Python 3.6.7 (default, Dec 5 2018, 15:02:05)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
>>>import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.27.2'
My local development database is SQLite, but my settings.py does not load any SQLite3 database backend when it senses it's in production on AWS (uses Mysql production database as backend when environment variable flag PRODUCTION is checked).
Is my understanding of the problem correct and is my approach and implementation acceptable?
I felt that recompiling python was a huge waste of time, and to be honest it may have been faster to stand up a local mysql version and stop wasting time with sqlite... but it's so nice to just copy or dump a file, migrate, and loaddata for a fresh start.
mock
data? – Ultramundane