Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django.db.utils.NotSupportedError: PostgreSQL 12 or later is required (found 11.19)

I am getting this error when I try to run my django server locally: "django.db.utils.NotSupportedError: PostgreSQL 12 or later is required (found 11.19).". The local django server is connected to a postgres instance hosted on ElephantSQL.

I have installed psycopg2-binary==2.9.6.

But when I run "python manage.py runserver", I get the error "django.db.utils.NotSupportedError: PostgreSQL 12 or later is required (found 11.19).". I tried upgrading my computer's postgres with homebrew, up to 12.5. This did not fix the problem, as I still get the same error (which still mentions 11.19). I do not know what instance of postgres this 11.19 refers to, and how to update it to 12 or above.

Ideas?

Note- another stack overflow post about this suggested downgrading my django version from a 4 to a 3, but this seems like a bad way to fix it.

like image 798
dl_atl Avatar asked Aug 30 '25 17:08

dl_atl


1 Answers

You need to downgrade your Django or upgrade your PostgreSQL version. I think downgrading django will be easier. For that you can do the following:

pip uninstall django

After uninstalling, you need to reinstall django but of lower version, for that you can use the following command:

pip install django==4.1

Django 4.2 does not support PostgreSQL lower than 12(as you said that you have Django 4.2), but Django 4.1 can use PostgreSQL 11.xx. Here is the documentation:

for Django 4.2: https://docs.djangoproject.com/en/4.2/ref/databases/#postgresql-notes

for Django 4.1: https://docs.djangoproject.com/en/4.1/ref/databases/#postgresql-notes

like image 74
Divya Prakash Avatar answered Sep 02 '25 06:09

Divya Prakash