Django "No installed app with label 'logs'" Error Even After Correcting Project Structure

I'm encountering a persistent "No installed app with label 'logs'" error in my Django project, even after seemingly correcting the project structure and INSTALLED_APPS. I've tried all the common solutions, but the issue remains.

Python Version: 3.13.2

Django Version: 5.1.6

os: Windows 11

Project Structure

router_log_project/
    manage.py
    router_log_project/  (Inner project directory)
        __init__.py
        settings.py
        urls.py
        wsgi.py
    logs/
        __init__.py
        models.py
        views.py
        migrations/
            __init__.py
    env/  
    db.sqlite3

settings.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'logs', 
]

Steps already taken

Double-checked INSTALLED_APPS: I've meticulously verified the spelling of 'logs' in INSTALLED_APPS.

Verified __init__.py files: I've confirmed that __init__.py files exist in both the inner router_log_project directory and the logs app directory.

Restarted the development server: I've restarted the server multiple times after making changes.

Deactivated/reactivated the virtual environment: I've tried creating a fresh virtual environment.

The Django application must contain a file such as "apps.py". This file contains the configuration of the application, which will later be initialized when the server is started.

This file contains a class of the following type:

from django.apps import AppConfig


class <your_app_name>Config(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = '<your_app_name>'

Looking at the hierarchy you provided, I dare say that you created the application directories and files inside manually. However, Django has a special command that will automatically create the application and all the necessary files for it.

In command line: python manage.py startapp <your_app_name>

The last step is to add a "link" to this application configuration class in the settings.

In settings.py:

INSTALLED_APPS = [
    ...
    '<your_app_name>.apps.<your_app_name>Config',
    # or just 
    '<your_app_name>'
]
Back to Top