I try to use MongoDB with Django. After several research, i found that to use both together, i had to:
- Downgrade Django to 3.1.12
- Install djongo
- Dwongrade Pymongo to 3.12.3
- Install pytz
Here is my models:
class Choice(models.Model):
choice_text=models.CharField(max_length=200)
votes = models.IntegerField(default=0)
class Meta:
abstract=True
class Question(models.Model):
question_text=models.CharField(max_length=200)
pub_date = models.DateTimeField()
choices=models.ArrayField(
model_container=Choice
)
I registered the model to the admin:
from .models import Question
# Register your models here.
admin.site.register(Question)
And run the server: everything goes alright.
However, when i try to add an item via administration site, i got the following exception: ')