from django.db import models
from django.contrib.auth.models import User

# Create your models here.
# Create your models here.
class Note(models.Model):
    # always reference the User class using setting conf
    author = models.ForeignKey(User)
    value = models.IntegerField(max_length=255)
    def __str__(self):
        return "your note is %s" % self.value

from django.db import models
from django.conf import settings

# Create your models here.
# Create your models here.
class Note(models.Model):
    # always reference the User class using setting conf
    author = models.ForeignKey(settings.AUTH_USER_MODEL)
    value = models.IntegerField(max_length=255)
    def __str__(self):
        return "your note is %s" % self.value

Migrate to a custom User class.
Migrate to a custom User class.

Step1: reference the User class, using the AUTH_USER_MODEL setting.

  from django.db import models
- from django.contrib.auth.models import User
+ from django.conf import settings
  
  # Create your models here.
  # Create your models here.
  class Note(models.Model):
      # always reference the User class using setting conf
-     author = models.ForeignKey(User)
+     author = models.ForeignKey(settings.AUTH_USER_MODEL)
      value = models.IntegerField(max_length=255)
      def __str__(self):
          return "your note is %s" % self.value
  
Migrate to a custom User class.
## Code Before:
from django.db import models
from django.contrib.auth.models import User

# Create your models here.
# Create your models here.
class Note(models.Model):
    # always reference the User class using setting conf
    author = models.ForeignKey(User)
    value = models.IntegerField(max_length=255)
    def __str__(self):
        return "your note is %s" % self.value

## Instruction:
Migrate to a custom User class.
## Code After:
from django.db import models
from django.conf import settings

# Create your models here.
# Create your models here.
class Note(models.Model):
    # always reference the User class using setting conf
    author = models.ForeignKey(settings.AUTH_USER_MODEL)
    value = models.IntegerField(max_length=255)
    def __str__(self):
        return "your note is %s" % self.value
