from django.db import connectioncursor = connection.cursor()cursor.execute('''SELECT * FROM Person''') person=cursor.fetchallfor person in persons: print(person.name) print(person.gender) print(person.age)
Person.objects.all()-----Example print in django----persons = Person.objects.all()for person in persons: print(person.name) print(person.gender) print(person.age)