
from django.core.management.base import BaseCommand, CommandError
from django.db import connections
from django.db.utils import OperationalError



class Command(BaseCommand):
	def handle(self, *args, **options):
		try:
			db_conn = connections['default']
			c = db_conn.cursor()
		except OperationalError:
			connected = False
		else:
			connected = True

		if connected:
			print("Connected")
		else:
			print("NOT Connected")


