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:
parent
04f9fe8252
commit
4d56d18a24
2 changed files with 4 additions and 1 deletions
|
@ -3,3 +3,6 @@ from django.apps import AppConfig
|
||||||
|
|
||||||
class ChatBoxConfig(AppConfig):
|
class ChatBoxConfig(AppConfig):
|
||||||
name = "chat_box"
|
name = "chat_box"
|
||||||
|
|
||||||
|
def ready(self):
|
||||||
|
from . import models
|
||||||
|
|
|
@ -12,7 +12,7 @@ class JudgeAppConfig(AppConfig):
|
||||||
# OPERATIONS MAY HAVE SIDE EFFECTS.
|
# OPERATIONS MAY HAVE SIDE EFFECTS.
|
||||||
# DO NOT REMOVE THINKING THE IMPORT IS UNUSED.
|
# DO NOT REMOVE THINKING THE IMPORT IS UNUSED.
|
||||||
# noinspection PyUnresolvedReferences
|
# 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.models import FlatPage
|
||||||
from django.contrib.flatpages.admin import FlatPageAdmin
|
from django.contrib.flatpages.admin import FlatPageAdmin
|
||||||
|
|
Loading…
Reference in a new issue