I'm using a database URL string in my settings like:
DATABASES = {
'default': "mysql://root:@localhost:3306/mydb"
}
When I migrate I get this warning:
MySQL Strict Mode is not set for database connection 'default'
Now my question: How can I combine the two things?
I cannot use the "regular" way to set the database settings with a dictionary because my database url comes from an environment variable.
Thx in advance!
I think this one will help you. you can pass the options as a query string in the URL
Try to give init_command of database options in settings.py If want know more refer the docs django_mysql.W001: Strict Mode
You could update your settings afterwards:
DATABASES['default']['OPTIONS'] = {'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"}