- Django 3 Web Development Cookbook
- Aidas Bendoraitis Jake Kronika
- 72字
- 2025-04-04 13:15:07
Getting ready
For this recipe to work, you will need to have the contenttypes app installed. It should be in the INSTALLED_APPS list in the settings, by default, as shown in the following code:
# myproject/settings/_base.py
INSTALLED_APPS = [
# contributed
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
# third-party
# ...
# local
"myproject.apps.core",
"myproject.apps.categories",
"myproject.apps.ideas",
]
Again, make sure that you have already created the myproject.apps.core app for your model mixins.