from django.contrib.auth.models import User
from datetime import datetime
from app.models import TimeRecord  # your_app_nameを実際のアプリ名に置き換えてください。
user_object = User.objects.get(username="admin")
time_record_data = TimeRecord(user=user_object, date=datetime.strptime('2023-04-01', '%Y-%m-%d'),time=120 )
time_record_data.save()