Import of django.contrib.admin.models.LogEntry in reversion.models causes startup error
See original GitHub issueThe top level import of django.contrib.admin.models.LogEntry
in the module reversion.models
causes a startup error in Django projects that don’t include django.contrib.admin
in INSTALLED_APPS
:
RuntimeError: Model class django.contrib.admin.models.LogEntry doesn’t declare an explicit app_label and isn’t in an application in INSTALLED_APPS.
Perhaps this import could moved into the Revision.get_comment()
method?
–
Affects version 3.0.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Tying in to Django Admin's Model History - Stack Overflow
The model is in django.contrib.admin.models.LogEntry. When a user makes a change, add to the log like this (stolen shamelessly from ...
Read more >Common problems — django-reversion 5.0.4 documentation
This is caused by your models.py file being imported twice, resulting in reversion.register() being called twice for the same model. This problem is...
Read more >The Django admin site
This function attempts to import an admin module in each installed application. Such modules are expected to register models with the admin. Typically...
Read more >django-reversion Documentation - Read the Docs
To enable this, simply register your models with a subclass of reversion.VersionAdmin. import reversion class YourModelAdmin(reversion.
Read more >django Changelog - pyup.io
Fixed a bug in Django 4.1 that caused a crash of model validation on ... The admin :meth:`history view <django.contrib.admin.ModelAdmin.history_view>`
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a possible solution, as I noted above, but not all projects use the Django admin and IMO shouldn’t be required to “install” it just to avoid this error.
Now that the PR has been merged I think this issue can be closed 😃