'Why do I get a django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet

from django.db import models

# Create your models here.
class Topic(models.Model):
    text = models.CharField(max_length=200)
    data_added = models.DateTimeField(auto_now_add=True)
    def __str__(self):
        return self.text

Why do I get this error?

django.core.exceptions.AppRegistryNotReady



Solution 1:[1]

As per the Django documentation on exceptions

This exception is raised when attempting to use models before the app loading process, which initializes the ORM, is complete.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Araelath