“No installed app with label 'admin'” running Django migration. The app is installed correctly

后端 未结 13 1205
失恋的感觉
失恋的感觉 2020-12-30 19:37

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

相关标签:
13条回答
  • 2020-12-30 20:01

    just check your "setting.py" in the installed apps section and make sure that you have added your app there :

    Application definition

    INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        **'you need to add your app here>>>>>>>>>>>>>>>>>>>>>>',
    ]**
    
    0 讨论(0)
  • 2020-12-30 20:04

    I got the same error (but unrelated to the issue mentioned in question). I was using mysql db but there were no mysql client.

    settings.py

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.mysql',
            # other details like name, user, host
        }
    }
    

    I installed mysqlclient (In ubuntu & Python3):

    sudo apt-get install libmysqlclient-dev
    sudo apt-get install python3-dev
    pip install mysqlclient
    
    0 讨论(0)
  • 2020-12-30 20:06

    For me it shows

    raise LookupError(message)
    

    LookupError: No installed app with label 'admin'.

    and I solve it by pip installing every requirements manually I m using ubuntu 16.04

    0 讨论(0)
  • 2020-12-30 20:07

    In my case, app name wasn't added to the settings.py file under "INSTALLED APPS" dictionary

    0 讨论(0)
  • 2020-12-30 20:08

    I also got this error after changing database from sqlite to postgresql and by installing psycog2 (which is used to connect django to postgre database) my error has gone.

    pip install psycog2

    0 讨论(0)
  • 2020-12-30 20:11

    For my case the LookupError was occuring because I had altered the models and added 'related_name' but had not run makemigrations and migrate.

    0 讨论(0)
提交回复
热议问题