register_seo_admin(admin.site, Coverage, ('title', )) register_seo_admin(admin.site, WithSites) try: admin.site.register(Product, admin.ModelAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(Page, admin.ModelAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(Tag, WithMetadataAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(NoPath, WithMetadataAdmin) except admin.sites.AlreadyRegistered: pass # Register alternative site here to avoid double import alternative_site = admin.AdminSite() alternative_site.register(Tag) auto_register_inlines(alternative_site, Coverage) alternative_site.register(Page) auto_register_inlines(alternative_site, WithSites) auto_register_inlines(alternative_site, WithSEOModels) alternative_site.register(Product)
register_seo_admin(admin.site, Coverage) register_seo_admin(admin.site, WithSites) try: admin.site.register(Product, admin.ModelAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(Page, admin.ModelAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(Tag, WithMetadataAdmin) except admin.sites.AlreadyRegistered: pass try: admin.site.register(NoPath, WithMetadataAdmin) except admin.sites.AlreadyRegistered: pass # Register alternative site here to avoid double import alternative_site = admin.AdminSite() alternative_site.register(Tag) auto_register_inlines(alternative_site, Coverage) alternative_site.register(Page) auto_register_inlines(alternative_site, WithSites) auto_register_inlines(alternative_site, WithSEOModels) alternative_site.register(Product)