The accepted answer is in order. But, since the OP asked the question in the context of adding new lines, not updating existing records. Here is a snippet of code to add new entries:
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('loginmodule', '0002_login_avatar'), ] def insertData(apps, schema_editor): Login = apps.get_model('loginmodule', 'Login') user = Login(name = "admin", login_id = "admin", password = "password", email = " admin@pychat.com ", type = "Admin", avatar="admin.jpg") user.save() operations = [ migrations.RunPython(insertData), ]
source share