Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

AssertionError: database connection isn’t set to UTC

AssertionError: Database Connection isn’t set to UTC

A recent update to psycopg2 version 2.9 is causing this issue

Psycopg 2.9 changed the value passed to tzinfo_factory from an int to a timedelta. Django 2.2 (possibly newer but I’m on 2.2) has a check for offset == 0 and since timedelta(0) != 0 it goes boom.

A current solution would be to downgrade psycopg2 (or psycopg2-binary if you are using the stand-alone package) below 2.9 (e.g. psycopg2>=2.8,) in your requirements file.

For instance you can downgrade to 2.8.6 using:

pip install psycopg2==2.8.6

or

pip install psycopg2-binary==2.8.6

If you’re using poetry, you can do poetry add [email protected] to fix your version to 2.8.6.



This post first appeared on Microsoft, IT, System Center, Infrastructure, please read the originial post: here

Share the post

AssertionError: database connection isn’t set to UTC

×

Subscribe to Microsoft, It, System Center, Infrastructure

Get updates delivered right to your inbox!

Thank you for your subscription

×