'I cannot register new admin panel block Django

I'm trying to register my model in admin panel by this code

from django.contrib import admin
from advertisements.models import Advertisement
    
    
@admin.register(Advertisement)
class AdvertisementAdmin(admin.ModelAdmin):
    pass

and I just got actually nothing

screenshoot

Am I doing something wrong?



Solution 1:[1]

You could try using something like:

class AdvertisementAdmin(admin.ModelAdmin):
    pass
    
admin.site.register(Advertisement, AdvertisementAdmin)

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 Javad Nikbakht