DJANGO #render방식1 파이썬(DJANGO) HTML DB연동 select하기(MVC패턴) DAO클래스 import pymysql class DaoEmp: # print("생성자") def __init__(self): self.conn = pymysql.connect(host='127.0.0.1', user='root', password='python', db='python', charset='utf8', port=3304) # Connection 으로부터 Dictoionary Cursor 생성 self.curs = self.conn.cursor(pymysql.cursors.DictCursor) #메소드 def selectList(self): # SQL문 실행 sql = """ select e_id, e_name, gen, addr from emp """ self.curs.execute(sql.. 2023. 7. 6. 이전 1 다음