Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

python connect to mysql in settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'website',
        'USER': 'root',
        'PASSWORD': '',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTION': {'init_command':"SET sql_mode='STRICT_TRANS_TABLE',"},
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #connect #mysql
ADD COMMENT
Topic
Name
1+4 =