I can't use UUID with DJ-STRIPE: DJStripe: Account has no field named 'uuid'

I am attempting to setup djstripe bit am encountering the following error. I do not have any Account model, nor do I see any mention of an Account model anywhere.

settings.py:

DJSTRIPE_SUBSCRIBER_MODEL = 'auth_app.CustomUser DJSTRIPE_FOREIGN_KEY_TO_FIELD = 'uuid'

AUTH_USER_MODEL = 'auth_app.CustomUser'

This is my models.py. Note that I am using abstractcuser in order to use email as the username.

from django.db import models
from django.contrib.auth.models import AbstractUser
import uuid
from cuser.models import AbstractCUser

class CustomUser(AbstractCUser):
    uuid = models.UUIDField(default=uuid.uuid4, unique=True)
    email = models.EmailField(unique=True)
    username = None
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = []

    def __str__(self):
        return self.email

This is the error that I am facing:

raise FieldDoesNotExist(
django.core.exceptions.FieldDoesNotExist: Account has no field named 'uuid'

I have tried to delete the migrations folder and the database file but the issue persists.

Please let me know if you require any further information.

Thank you.

Вернуться на верх