Forums

SQLite upgrade required

Hi,

I was playing about with my webapp and I installed django rest framework.

It seems to have upgraded some files as the webapp isn't loading anymore. The error I get is:

*> python3.6/site-packages/django/db/backends/sqlite3/base.py", line 65,

in check_sqlite_version 2020-04-23 03:53:40,508: raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)*

I read that to upgrade the SQLite database I need to ask you to move to a newer server image?

The django version I'm running is 1.11.5. I would like to upgrade that as well. Will this new server image take care of that? What versions will it upgrade to?

I suppose I'd have to go through my django code and make sure the style changes between django 1.11 and whatever the new version is have been made?

Obviously, my files will remain unchanged during this process?

Thanks, Andy

Hi Andy,

Yes, that's right -- we need to switch you over to a new system image in order for you to get the updated version of SQLite. Your files and data will be kept unchanged, so that should work fine. The version of Django that you get will depend on how you are using it -- if you're using a virtualenv, then it won't change, because the virtualenv is part of your own files, which we don't change. If you're using the system install of Django, then it will change. One thing that's worth noting if you are using a virtualenv is that you might need to rebuild it; the system update will change the point releases of Python (for example, 3.6.0 will become 3.6.9), and virtualenvs are not necessarily compatible between different point releases of Python.

If you're happy for us to go ahead despite this, just let us know.

Hi,

Yes that's fine, I am using the system version not a virtual environment. I'll maybe use that in the future.

Please upgrade the system image :)

Thanks, Andy

No problem, I have updated your system image.

Thanks for the work you've done. The Sqlite database has been successfully upgraded.

Is there a system image with django v2 and python v3? Or should I use virtual environments?

$ python --version Python 2.7.12

$ python manage.py --version 1.11.26

Thanks, Andy

sure, you could use a virtual environment. Or if you want we could update you to our latest system image, which as python3.8 and django 2.2.7. However, since this may break your other code because it would change the library versions, and you would have to rebuild any virtualenvs you have.

Hi,

Yes, upgrade me to the latest image.

I'll still use a virtual environment but I'm planning on overhauling the code anyway. At least that way, I'd probably never need to do another upgrade.

Andy

Hmm, you're already on the latest image, as Glenn said -- I think Conrad was confused.

When running outside a virtualenv, to run Python 3.x, you just need to use the version of the python command that corresponds to the version of Python that you want, for example python3.7 or python3.8. The command python on its own is an alias to python2.7 because the operating system requires that at the moment.

Also outside the virtualenv, there are also matching versions of the pip command, eg. pip3.7 and pip3.8, and pip on its own is likewise aliased to pip2.7. We have updated versions of Django pre-installed for Python 3.x, but Python 2.7 is stuck on Django 1.11 because the Django team dropped support for Python 2.x after that release.

In order to use a particular version of Python inside a virtual environment, you need to specify the version that you want when you create it, and (once more) the default is Python 2.7. So, to create a virtualenv using 3.8, you would do this:

mkvirtualenv myenvname --python=python3.8

Help upgrade mine too. am experiencing the same issue

No problem. I have updated your system image.

Help upgarde mine too. I am experiencing the same issue.

No problem -- that's done now. Any new consoles you start will have the new system image; websites and scheduled tasks will pick it up the next time they're started.

Hi team, Can you please upgrade my system image too? I understand the risk about virtualenv. I want to have SQLite 3.25 or newer.

You're already on the most recent system image which supports SQLite 3.11.0.

Hi team. I think I need Sqlite 3.8.3 or later. I have 3.8.2. I have a virtualenv. So I think all is good. Can you please upgrade my image? Big thanks beforehand.

@arindam31 It's done for you

Just a note to say that you no longer need to ask to have your system image changed -- you can change it yourself from the "Account" page. There's more information on this help page.