2
You are trying to access the related object, while it does not exist when you would do u.userprofile
Try it the same way you are creating the User
object instead:
UserProfile.objects.create(user=u, company_name="onetwo")
Source:stackexchange.com