I am trying to use admin.LogEntry objects during a datamigration on Django 1.7
The 'django.contrib.admin'
app is listed on INSTALLED_APPS
.
On the shell, it works:
>>> from django.apps import apps
>>> apps.get_model('admin', 'LogEntry')
django.contrib.admin.models.LogEntry
But during the migration, it fails:
def do_it(apps, schema_editor):
LogEntry = apps.get_model('admin', 'LogEntry')
Fails like this:
django-admin migrate
(...)
LookupError: No installed app with label 'admin'.
Using a debugger, I got that the 'admin' is not installed:
ipdb> apps.get_apps()
[]
ipdb> apps.all_models.keys()
['website', 'google', 'allauth', 'twitter', 'busca', 'conteudo', 'django_mobile', 'django_filters', 'videocenter', 'tinymce', 'oferta', 'programacaotv', 'contenttypes', 'suit', 'haystack', 'destaque', 'filer', 'galeria', 'auth', 'facebook', 'paintstore', 'critica', 'disqus', 'fichas', 'omeletop', 'autocomplete_light', 'modelsv1', 'temas', 'django_extensions', 'adv_cache_tag', 'taggit', 'social', 'personalidade']
WHY??
question from:
https://stackoverflow.com/questions/29565665/no-installed-app-with-label-admin-running-django-migration-the-app-is-insta