I have a django model class which have a field of ‘amount’ I used pip install django-moneyfield
install money field but I got an error when I run migration
My Code:
class Student(models.Model):
user = models.ForeignKey(CustomUser, on_delete = models.CASCADE)
fee = MoneyField(decimal_places = 2, max_digits = 8,
amount_default = Decimal("0"),
currency_default = "INR",
null = True, blank = True)
2
Answers
the module
django.forms.util
is an old module of django which has been renamed after django 1.7 indjango.forms.utils
django-moneyfield is an old django module which is not maintenand from 2017. I think you can replaced it by django-money which is up-to-date
the last release for
django-moneyfield
package is in 2013.You can research an alternative package it seems this package is not supported anymore. You can use DjangoMoney instead.