0

This error may point to a model but it is mainly an incompatibility with Postgres package.

In a new postgres databases it may include following error when doing initial migration: "AssertionError: database connection isn't set to UTC"

I got same error with Python 3.8 & 3.10 + Django 3 & 4.

Jorge
  • 57
  • 7

1 Answers1

0

As mentioned in AssertionError: database connection isn't set to UTC the issue is the psycopg2 version 2.9 which is incompatible with Django 2.x, 3.x & 4.x.

The solution is very simple:

You can downgrade to 2.8.6 using:

pip install psycopg2==2.8.6

or

pip install psycopg2-binary==2.8.6

Then it all works as usual.

Jorge
  • 57
  • 7