Run a script to fill in a model

I have a script that fills a model (a table) with data. To run the script I do python manage.py shell < script.py it worked correctly several times but there it no longer fills the table I don't know why.

import names
from app.models import Employee, Sector
from random import randint

s1 = Sector.objects.create(namesector="marketing", codesector="MKT"); s1.save()
for i in range(10):
       n = names.get_full_name().split(" ")
       p = Employee.objects.create_user(firstname=n[0], name=n[1], regID=str(i).zfill(2), codesector="MKT", password=str(i).zfill(2))
       p.save()

Only s1 is added to the Sector table, the employee table remains empty. When i write line by line directly in the shell the data is added correctly for the employee table.

Back to Top