- Check the demo repo on GitHub
- Python 3.8+ supported.
- Django 3.2+ supported.
- Install from pip:
pip install django-model-mixin
- Modify
settings.py
by adding the app toINSTALLED_APPS
:
INSTALLED_APPS = [
# ...
"model_mixin",
# ...
]
- Modify your project
models.py
with needed imports and class extends:
# ...other imports...
from model_mixin.models import AuditModelMixin, PublishModelMixin
class MyCustomClass(AuditModelMixin, PublishModelMixin):
# ...
- Execute Django's command
makemigrations
inside your project's root:
python manage.py makemigrations
- Finally, execute Django's command
migrate
inside your project's root:
python manage.py migrate
git clone --depth=50 --branch=django-model-mixin https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver
Now browser the app @ http://127.0.0.1:8000