def pg_check():
    try:
        a_user = User.objects.all()[:1].get()
    except:
        a_user = None
    return (a_user is not None, None)
check django db
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/views.py/pg_check