Ad Code

✨🎆 Codex 1.0 PLACEMENT READY PROGRAM! 🎆✨

Get 75% Discount Early bird offer CLICK to JOIN CodeX 1.0 click

How we add new column in django




to add a new column or file in Django after creating a table we should manage the following steps

1)  go into model.py and add field if filed is CharacterField then write

models.CharField(max_length=100, default='')

if field is DateTime then write following 
code 
models.DateTimeField(auto_now=True)

2)  python manage.py makemigrations appname


3)  python manage.py migrate



Post a Comment

0 Comments