django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. what to do

Hi everyone, I’m facing this error: “django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet…” when entering the following commands into the Python console - “from products.model import ProductsCategory, what to do?

thats is my models.py

from django.db import models 

class  ProductCategory(models.Model):
    name = models.CharField(max_length=128, unique=True)
    description = models.TextField(null=True, blank=True)

class Product(models.Model):
    name = models.CharField(max_length=256)
    description = models.TextField()
    price = models.DecimalField(max_digits=6, decimal_places=2)
    quantity = models.PositiveIntegerField(default=0)
    image = models.ImageField(upload_to='products_images')
   category = models.ForeignKey(to=ProductCategory, on_delete=models.CASCADE)

Side note: When posting blocks of code here, enclose the code between lines of three backtick - \ characters. This means you’ll have a line of \, then your code, then another line of \. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of fixing your original post for you.)
(Use the single backtick - ` for single lines or parts of a line.)

When you say:

Are you using the manage.py shell command or are you trying to run this directly using the python shell?

If you are doing this from the shell command, this is frequently caused by having a statement that is trying to perform an ORM operation at the module or class level (outside of a function).