Let’s go through the checklist found in the official docs and try a few other things.
Initial check list
- While coping
widgets
from otherform
you changed the names. Rightmodel
, rightfield
, righturl
. - Your
url
must be reversable. Runshell
in the Django console and thendjango.urls.reverse('your_url_name')
– it must return something. - You use
ModelSelect2Multiple
forManyToManyField()
andModelSelect2
forForeignKey()
Initial check list
- Your
ManyToManyField()
should not have athrough
table. There is no point in that at all. - Your
ManyToManyField(
) in admin should not be altered by being included infilter_horizontal
. See the difference on the pictures (the first is without the field being included infilter_horizontal
and the second is with)
Without being included in filter_horizontal With being included in filter_horizontal
- Don’t forget to set
form = YourForm
inModelAdmin
inherited class for your model. - In case you decided to alter the project’s urls, if you have separate ones for development and production, don’t forget to keep that in line 🙂