title: Python: TypeError: an integer is required (got type str)
body: <p>here i am getting the error, </p>
  
  <pre><code> File "C:\Users\DEEDEVTR01\Desktop\python\pyenv\lib\site-packages\MySQLdb\__init__.py",
   line 84, in Connect
   return Connection(*args, **kwargs)   File "C:\Users\DEEDEVTR01\Desktop\python\pyenv\lib\site-packages\MySQLdb\connections.py",
   line 179, in __init__
   super(Connection, self).__init__(*args, **kwargs2) TypeError: an integer is required (got type str)
  </code></pre>
  
  <p>I think the connection is proper but I am not sure why I am getting this error, it would be great if anyone can help me figure out what I am doing wrong.</p>
  
  <p>settings.py</p>
  
  <pre><code>
  DATABASES = {
      'default': {
          # 'ENGINE': 'django.db.backends.sqlite3',
          # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
          'ENGINE': 'django.db.backends.mysql',
          'HOST': 'localhost',
          'NAME': 'deebaco',
          'USER': 'deebaco',
          'PASSWORD': 'deebaco',
          'PORT': '3306',
      }
  }
  
  
  import MySQLdb
  
  def connection():
      conn = MySQLdb.connect(database="deebaco", user = "deebaco", password = "deebaco", host = "localhost", port = "3306")
  
      print ("Opened database connect successfully")
  
      cur = conn.cursor()
  
      return cur, conn
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from rest_framework import views
  from rest_framework.views import APIView
  
  import MySQLdb
  from testpro.settings import connection
  cur, conn = connection()
  
  class Product_ListAPIView(APIView):
      def get(self,request,format=None):
          cur,conn = connection()
          query = ''' SELECT * FROM products'''
          try:
              with conn.cursor(MySQLdb.cursors.DictCursor) as cursor:
                  cursor.execute(query)
                  result = cursor.fetchall()
                  data = list(result)
  
              return Response({"data":result},status=status.HTTP_200_OK)
          except Exception as e:
              print(e)
  
  </code></pre>
  
  <p>I think the connection is proper but I am not sure why I am getting this error, it would be great if anyone can help me figure out what I am doing wrong</p>