'My app is not showing in Django admin panel

I have problem with Django admin panel. I have two apps: 'users' and 'advertisements'. App 'users' was installed before app 'advertisements'. Both apps are included in 'INSTALLED_APPS', but in admin panel showing only app 'users'. What problem can it be? Thanks a lot.

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'phonenumber_field',
    'users.apps.UsersConfig',
    'advertisements.apps.AdvertisementsConfig',
]

advertisementes/apps.py

from django.apps import AppConfig


class AdvertisementsConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'advertisements'

advertisements/admin.py

from django.contrib import admin
from .models import *


class AdvertisingSpaceAdmin(admin.ModelAdmin):
    list_display = ('id', 'title', 'description', 'slug', 'data', 'user')
    


admin.site.register(AdvertisingSpace, AdvertisingSpaceAdmin)


Solution 1:[1]

Try registering the apps like this:

admin.site.register(AdvertisingSpace)
admin.site.register(AdvertisingSpaceAdmin)

Solution 2:[2]

If you are not working with signals, for example, there is no point of adding users.app.UsersConfig into INSTALLED_APPS. Just add the app name into INSTALLED_APPS as 'users' only.

Other point that you are doing in which is not a good practice is importing your models like this:

from .models import *

The best way you can do is importing only the model you want or all of them (EXPLICITLY) to avoid any error.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ciurca
Solution 2 Elias Prado