How to Solve Error Message No installed app with label ‘app’ when execution makemigrations in Django Application

Posted on

Error Message No installed app with label ‘app’ Introduction Background

Before getting on to the solution for solving the error message, this part will describe how the error message can appear. The error message which is actually part of the title of this article appear upon executing a certain command. That command’s execution exist as follows :

(env) C:\repository\django\project\myproject>python manage.py startapp myapp

(env) C:\repository\django\project\myproject>python manage.py makemigrations myapp
No installed app with label 'myapp'.

(env) C:\repository\django\project\myproject>

Solution

Well, basically the error solving step is quite easy. In the introduction part or segment, the command execution is involving the ‘myapp’ string part. That string part of ‘myapp’ is a part for defining the application name as in the first command execution above. That first command is ‘python manage.py startapp myapp’. The first command is just a simple command to create a new application. The second command is also a command containing ‘myapp’ string as part of the command execution. But the aim or the purpose is very different. The second command is a command to create a migration script for every model available in the application with the name of ‘myapp’. The following is the solution for solving it :

  1. Just access the file with the name of ‘settings.py’ exist in the project folder. Suppose that the project name is ‘myproject’ as it exist in the introduction part, the location of ‘settings.py’ file will be available in myproject\myproject.

  2. Open the ‘settings.py’ file. Search the part for defining ‘installed application’ as follows :

    # Application definition
    INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
    ]
  3. Edit that part by adding the application name in the last line. So, the revision of the above part will exist as follows :
    # Application definition
    INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'myapp',
    ]
    
  4. Run the above command as in the introduction part once more, if there is no other error messages appear the command will run properly.

3 thoughts on “How to Solve Error Message No installed app with label ‘app’ when execution makemigrations in Django Application

    1. There can be a couple reasons for triggering that error :
      1. The application name is incorrect. Is the name is really ‘app’ ?
      2. The application does not exist. Check the folder location of the application with the name ‘app’ by default exist in the same level of the project folder.
      3. The application configuration file is not correct. It exist in the application folder with the name of ‘apps’py. Just check whether the name property’s value of the App class describing the correct folder structure location.

Leave a Reply