Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
315 stars 414 forks source link

[Django] deactivated strict_trans_tables break Django/Mysql setup #1698

Open nerdoc opened 9 months ago

nerdoc commented 9 months ago

A Django setup seems to need strict_trans_tables in mysql. So if you setup Django on an Uberspace 7, and start the server, you get a warning.

you can prevent this by adding the sql_mode: traditional to the database options in your django setup:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'OPTIONS': {
            'sql_mode': 'traditional',  # tolerate deactivated strict_trans_tables
        }
    }
}

Uberspace should add that to the Django setup guide in Uberspace lab.