Model (Database) in Django

from django.db import models

class basicinfo(models.Model):

unique=True makes sure that all the person have unique first name.

python makemigrations APP

python shell


QuerySet[] will be empty at first, you can check by calling the function before creating an object.

Thank you for reading, if you liked the article please click on the clap button and show your support. You can clap more than once, just keep pressing the icon!!!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store