[Answer]-Why is the django admin area throwing an error when I try to access my app?

1👍

As you are dealing with a many to many relation your InlineModelAdmin should look like this:

class TagInline(admin.TabularInline):
    model = Tag.posts.through
👤arie

0👍

Maybe you can try setting the model field for posts to

posts = models.ManyToManyField(Post, null=True, blank=True).

I guess the post might not be created, so it is not able to create a tag or “connect” a tag with a post.

0👍

your many to many field should be on the post model not the tag model. objects must be defined in order or you must models.ManyToManyField(‘tag’) this is not recommended unless unavoidable. so define tag first then post so you can do with just (tag) under post model. i would suggest just using django tagging. it has always served me well.

after all thats what makes django so appealing is reusable apps and fast development.

👤eusid

Leave a comment