i am trying to make use of django to retrieve data from my sign up form and pass it into my database in pgadmin 4 as a query. I got error and doesnt know how to go about doing it. This is my code which i tried to use pymysql.
Thanks in advance
def booknow(request): c = pymysql.connect(host='localhost', user='postgres', password='pw', db='users') cur = c.cursor() if request.method == 'POST': display_name = request.POST.get['your-name'] email = request.POST.get['your-email'] age = request.POST.get['your-age'] phone_number = request.POST.get['phone-number'] gender = request.POST.get['your-gender'] vaccination_status = request.POST.get['your-vaccination'] password = request.POST.get['your-password'] insert_query = "INSERT INTO users (display_name, email, age, phone_number, gender, vaccination_status, password) VALUES ('%s','%s','%s','%s','%s','%s','%s');" % (display_name,email,age,phone_number,gender,vaccination_status,password) c = connection.cursor() c.execute(insert_query) return render(request, 'booknow.html')