python - how can I check database connection to mysql in django -


how can it?

i thought, can read database, looks much, there like?:

settings.databases['default'].check_connection() 

all need start application , if not connected fail. other way can try on shell try following -

from django.db import connections django.db.utils import operationalerror db_conn = connections['default'] try:     c = db_conn.cursor() except operationalerror:     connected = false else:     connected = true 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

wpf - C# NAudio - Changing audio playback position still plays a small buffer of old position -

Log not being recorded for quickfix c++ Session -