votes up 3

MySQL backend does not support timezone-aware datetimes when USE_TZ is False.

Package:
django
github stars 59414
Exception Class:
ValueError

Raise code

            return value

        # MySQL doesn't support tz-aware datetimes
        if timezone.is_aware(value):
            if settings.USE_TZ:
                value = timezone.make_naive(value, self.connection.timezone)
            else:
                raise ValueError("MySQL backend does not support timezone-aware datetimes when USE_TZ is False.")
        return str(value)

    def adapt_timefield_value(self, value):
        if value is None:
            return None

        # Expression values are adapted by the database.
😲 Agile task management is now easier than calling a taxi. #Tracklify

Ways to fix

votes up 2 votes down

To fix it, just set in settings.py:

USE_TZ = True
Jun 02, 2021 brucehardywald answer

Add a possible fix

Please authorize to post fix