1

I have a django app called my_app that uses django-userena; I am trying to create and use my own profile model by following the django-userena installation documentation.

In my_app/models.py I've added

from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from userena.models import UserenaBaseProfile

class MyProfile(UserenaBaseProfile):
    user = models.OneToOneField(User,
                                unique=True,
                                verbose_name=_('user'),
                                related_name='my_profile')
    favourite_snack = models.CharField(_('favourite snack'),
                                       max_length=5)

And then I've modified my_app/settings.py to include AUTH_PROFILE_MODULE = 'my_app.MyProfile' .

And yet, when I try to view any web page from my_app I get a SiteProfileNotAvailable. This error goes away if I move MyProfile to accounts/models.py

It seems like a bad idea to modify the accounts app in order to add custom fields. Am I wrong? Is there a way to add a custom profile module without modifying accounts/models.py?

loseeka
  • 117
  • 1
  • 9
  • You will find the answer in another thread: http://stackoverflow.com/questions/6809501/configuring-django-userena – aribo Feb 18 '14 at 15:07

1 Answers1

0

I had the same issue. For me it happened because I forgot to put my_app (or accounts as in the official docs) into INSTALLED_APPS.

rumpel
  • 7,870
  • 2
  • 38
  • 39