Django admin 'Please correct the error below' (tested)
Django admin shows Please correct the error below. when the change form fails validation. If no field is marked red, the error belongs to a form field that is not rendered, usually one missing from fieldsets.
Setup used in every block
common.py configures a minimal project (admin, auth, sessions, messages, an in-memory SQLite database and one app, shop), logs in a superuser with the Django test client, and defines show(), which prints the status code, the red banner (p.errornote) and each ul.errorlist on the returned admin page. The model:
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=50)
sku = models.CharField(max_length=20, unique=True)
slug = models.SlugField() # required, but hidden from the admin form below
class Meta:
app_label = 'shop'
1. The normal case: the error is shown next to a field
from common import *
from shop.models import Product
from django import forms
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = ['name', 'sku']
def clean(self):
d = super().clean()
if d.get('name') == d.get('sku'):
# attach to a field the form does not have
self.add_error(None, 'Name and SKU must differ.')
return d
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
form = ProductForm
fields = ['name', 'sku']
def save_model(self, request, obj, form, change):
obj.slug = obj.sku.lower(); super().save_model(request, obj, form, change)
Product.objects.create(name='Cup', sku='C1', slug='c1')
print('--- duplicate sku')
show(client.post('/admin/shop/product/add/', {'name': 'Cup 2', 'sku': 'C1'}))
print('--- two errors')
show(client.post('/admin/shop/product/add/', {'name': '', 'sku': 'C1'}))
print('--- non-field error')
show(client.post('/admin/shop/product/add/', {'name': 'X', 'sku': 'X'}))
print('--- valid')
r = client.post('/admin/shop/product/add/', {'name': 'Bowl', 'sku': 'B1'})
print('status', r.status_code, r.headers.get('Location'), Product.objects.count())
Output:
--- duplicate sku
status 200
banner: Please correct the error below.
errorlist: Product with this Sku already exists.
--- two errors
status 200
banner: Please correct the errors below.
errorlist: This field is required.
errorlist: Product with this Sku already exists.
--- non-field error
status 200
banner: Please correct the error below.
errorlist: Name and SKU must differ.
--- valid
status 302 /admin/shop/product/ 2
The banner is only a summary. The admin says Please correct the error below. for one error and Please correct the errors below. for more than one, and each message is listed above the field it belongs to. Errors from clean() with add_error(None, ...) are non-field errors and appear at the top of the form. A successful save returns 302 to the changelist.
2. Banner but no visible error: the field is not on the page
from common import *
from shop.models import Product
from django import forms
class ProductForm(forms.ModelForm):
reason = forms.CharField() # declared, required
class Meta:
model = Product
fields = ['name', 'sku', 'slug']
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
form = ProductForm
fieldsets = [(None, {'fields': ['name', 'sku', 'slug']})] # 'reason' not listed
from django.test.utils import setup_test_environment
setup_test_environment() # lets us read r.context
r = client.post('/admin/shop/product/add/', {'name': 'Mug', 'sku': 'M1', 'slug': 'mug'})
show(r)
print('hidden error:', r.context['adminform'].form.errors.get_json_data())
Output:
status 200
banner: Please correct the error below.
hidden error: {'reason': [{'message': 'This field is required.', 'code': 'required'}]}
This is the confusing case. The custom form declares a required field, reason, but the admin's fieldsets (or fields) do not list it. Declared form fields stay on the form class, so validation fails with This field is required., yet the admin only renders the fields in fieldsets, so the page shows the banner and no error list. The same happens with errors in an inline formset you didn't render or scrolled past.
To find the hidden error, print form.errors (as above; save_model() is never called for an invalid form), or temporarily remove fieldsets so every form field is rendered. Then fix it: add the field to fieldsets, give it required=False, or remove it from the form.
3. Model fields left out of the form are not validated
from common import *
from shop.models import Product
@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
fields = ['name', 'sku'] # slug left out of the form
show(client.post('/admin/shop/product/add/', {'name': 'Mug', 'sku': 'M1'}))
print('saved slug:', repr(Product.objects.get().slug))
Output:
status 302
saved slug: ''
The opposite case: slug is required on the model (no blank=True), but because it is not in fields the admin form skips it, there is no error, and the row is saved with an empty string. If the admin should fill it, set it in save_model() (as in section 1) or prepopulated_fields.
Related: Django CSRF verification failed, Django TemplateDoesNotExist.
Frequently asked questions
Why does Django admin say 'Please correct the error below' with no error shown?
A form field that fails validation is not rendered, usually a required field declared on a custom form but missing from fieldsets or fields. Print form.errors to see it.
Does the admin validate model fields that are not in fields?
No. Fields left out of the form are not validated; a required CharField is saved as an empty string unless you set it in save_model().
Written with AI assistance. Measured on 2026-10-23 with Django 6.1.2 and Python 3.14.7 (python:3-alpine in Docker, Django test client). Each block was run verbatim and the output pasted unedited. PlainHeaders is our extension; Python and Django are free.