Import models when django ready

Since we store model's instances in cache, this will help django figure out the correct model when unserializing cache data.
This commit is contained in:
cuom1999 2024-05-03 15:22:24 -05:00
parent 04f9fe8252
commit 4d56d18a24
2 changed files with 4 additions and 1 deletions

View file

@ -3,3 +3,6 @@ from django.apps import AppConfig
class ChatBoxConfig(AppConfig):
name = "chat_box"
def ready(self):
from . import models

View file

@ -12,7 +12,7 @@ class JudgeAppConfig(AppConfig):
# OPERATIONS MAY HAVE SIDE EFFECTS.
# DO NOT REMOVE THINKING THE IMPORT IS UNUSED.
# noinspection PyUnresolvedReferences
from . import signals, jinja2 # noqa: F401, imported for side effects
from . import models, signals, jinja2 # noqa: F401, imported for side effects
from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.admin import FlatPageAdmin