{"id":22969,"library":"wagtail-modeladmin","title":"Wagtail ModelAdmin","description":"Add any model in your project to the Wagtail admin with full CRUD and customisation. Formerly part of Wagtail core as `wagtail.contrib.modeladmin`. Version 2.3.0 (latest) supports Wagtail 6.x and Python >=3.10. Release cadence is irregular, roughly every 6-12 months.","status":"active","version":"2.3.0","language":"python","source_language":"en","source_url":"https://github.com/wagtail/wagtail-modeladmin","tags":["wagtail","admin","modeladmin","crud","django"],"install":[{"cmd":"pip install wagtail-modeladmin","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required peer dependency, version >=5.2","package":"wagtail","optional":false}],"imports":[{"note":"wagtail.contrib.modeladmin was removed in Wagtail 6.0. Use this standalone package instead.","wrong":"from wagtail.contrib.modeladmin.options import ModelAdmin","symbol":"ModelAdmin","correct":"from wagtail_modeladmin.options import ModelAdmin"},{"note":"","wrong":"","symbol":"ModelAdminGroup","correct":"from wagtail_modeladmin.options import ModelAdminGroup"},{"note":"","wrong":"","symbol":"InspectorPanel","correct":"from wagtail_modeladmin.views import InspectorPanel"}],"quickstart":{"code":"from wagtail_modeladmin.options import ModelAdmin, modeladmin_register\nfrom myapp.models import MyModel\n\nclass MyModelAdmin(ModelAdmin):\n    model = MyModel\n    menu_label = 'My Model'\n    menu_icon = 'pilcrow'\n    list_display = ('title', 'date')\n    search_fields = ('title',)\n\nmodeladmin_register(MyModelAdmin)","lang":"python","description":"Registers a Django model in the Wagtail admin sidebar."},"warnings":[{"fix":"Replace `from wagtail.contrib.modeladmin...` with `from wagtail_modeladmin...`.","message":"wagtail.contrib.modeladmin is removed in Wagtail 6.0. You must install wagtail-modeladmin and update imports.","severity":"breaking","affected_versions":"Wagtail >=6.0"},{"fix":"Call `modeladmin_register(YourModelAdmin)` at module level in your wagtail_hooks.py.","message":"modeladmin_register is required (not just registering with @hooks like before). If you forget, the admin will not appear.","severity":"gotcha","affected_versions":"All"},{"fix":"For Wagtail 5.2, install wagtail-modeladmin==1.0.0 or compatible.","message":"If you are on Wagtail 5.2, you must use wagtail-modeladmin 1.x. Version 2.x requires Wagtail >=6.0.","severity":"gotcha","affected_versions":"wagtail-modeladmin >=2.0"},{"fix":"Rename `form_fields_exclude` to `exclude_form_fields` in your ModelAdmin class.","message":"The `form_fields_exclude` attribute is deprecated. Use `exclude_form_fields` instead.","severity":"deprecated","affected_versions":">=2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Change to `from wagtail_modeladmin.options import ModelAdmin`.","cause":"Import from the wrong module (wagtail.contrib.modeladmin).","error":"ModelAdmin class not found: 'ModelAdmin' is not defined"},{"fix":"Install with `pip install wagtail-modeladmin` and use `from wagtail_modeladmin.options import ModelAdmin`.","cause":"The package is not installed or import path is wrong.","error":"ImportError: cannot import name 'ModelAdmin' from 'wagtail_modeladmin' (unknown location)"},{"fix":"Override `get_menu_label()` or `get_menu_icon()` directly; avoid using removed internal methods.","cause":"Internal API change in version 2.x. Method removed.","error":"AttributeError: 'MyModelAdmin' object has no attribute 'get_app_label_from_model_name'"},{"fix":"Remove the `style_prefix` argument. Use `menu_icon` and CSS customisation via `extra_css`.","cause":"Styling API changed between major versions.","error":"TypeError: __init__() got an unexpected keyword argument 'style_prefix'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}