34👍
Exactly the same problem had happened to me. The problem was that I had defined a model twice! Removing one of them solved the problem.
5👍
Check in your models if you don’t got a duplicate class model, sometimes when we make a rebase or merge in our existing branches, our code can be duplicated, i had the same problem, isn’t a big deal.
- [Django]-How to combine multiple QuerySets in Django?
- [Django]-Django: Hide button in template, if user is not super-user
- [Django]-Django dump data for a single model?
4👍
I got the same error when mistakenly defining 2 of the same name models(classes) in "models.py" as shown below:
# "models.py"
from django.db import models
class Product(models.Model):
name = models.CharField(max_length=100)
class Product(models.Model):
title = models.CharField(help_text=_("Required"), max_length=200)
- [Django]-How do I prevent fixtures from conflicting with django post_save signal code?
- [Django]-RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
- [Django]-Testing Python Decorators?
2👍
I have gotten this error because of automatic imports I had in my __init__.py
. I had some old code that imported by signals there, and moving that import code to AppConfig instead fixed it.
- [Django]-AccessDenied when calling the CreateMultipartUpload operation in Django using django-storages and boto3
- [Django]-No module named django but it is installed
- [Django]-How do I modify the session in the Django test framework
1👍
It is saying that you have already registered the model before
Hence by deleting the second model or writing the code in the specified model is the solution for this .
- [Django]-Is it possible to reference a property using Django's QuerySet.values_list?
- [Django]-How do I tell if a Django QuerySet has been evaluated?
- [Django]-Django-taggit – how do I display the tags related to each record