I am pretty new with django. I am using django, mongoengine, django-social-auth to build authentication system and to store user profile in mongodb.
I am in process of using 'Custom User Model' mechanism provided by django as follows:
from mongoengine import *
from mongoengine.django.auth import User
class UserProfile(User):
imageUrl = URLField()
def __init__(self):
User.__init__()
settings.py include ('users' is app name):
SOCIAL_AUTH_USER_MODEL = 'users.UserProfile'
When I execute 'python manage.py runserver', got following error:
social_auth.usersocialauth: 'user' has a relation with model users.UserProfile, which has either not been installed or is abstract.
When I change my UserProfile class to inherit from models.Model as follows:
from mongoengine import *
from mongoengine.django.auth import User
from django.db import models
class UserProfile(models.Model):
imageUrl = URLField()
def __init__(self):
User.__init__()
,running 'python manage.py runserver' started development server without an issue.
So I guess, Custom User Model must be inherited from models.Model. So how should I workaround to inherit my custom user model from mongoengine.django.auth.User.