title: Creating a foreign key for user from one app to another in Django
body: <p>I wanted to create a user foreign key in my tasks models.py to another table called UserProfile. I want a task to be associated to a user so when I go to query it and display it in a profile page, I don't see anyone else's. However, when I attempted this, I got this error:</p>
  
  <p><a href="https://i.stack.imgur.com/KY30s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KY30s.png" alt="enter image description here"></a></p>
  
  <p>This is my tasks.model.py</p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from useraccounts.models import UserProfile
  
  class Task(models.Model):
      task_name = models.CharField(max_length=140, unique=True)
      owner = models.ForeignKey('user')
      description = models.CharField(max_length=140)
      create_date = models.DateField()
      completed = models.BooleanField()
      private = models.BooleanField()
  
      def __unicode__(self):  # Tell it to return as a unicode string (The name of the to-do item) rather than just Object.
          return self.name
  </code></pre>
  
  <p>This is my useraccounts.models.py</p>
  
  <pre><code>class UserProfile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE, default='')
      username = models.CharField(max_length=14, default='')
      birth_date = models.DateField(null=True, default = '2000-01-01', blank=True)
      email = models.EmailField(null=True, default='')
  </code></pre>