I'm learning django now, watch tutorials. The questions is: What is the difference between using:
from django.contrib.auth import get_user_model User = get_user_model()
User = get_user_model()
and
from django.contrib.auth.models import User
I've seen both of them and both of them used in model with ForeignKey, but I don't know the difference between these two model, for example:
author = models.ForeignKey(
User,
on_delete=models.CASCADE,
related_name='posts'
)
title = models.CharField(max_length=100)
text = models.TextField()```