I have an application called aaa and in models.py in aaa I have sth like:
from django.db import models
from django.contrib.auth.models import User
class BBB(models.Model):
user = models.OneToOneField(User)
newsletter=models.BooleanField(default=False)
I add setup.py to my parameter
AUTH_PROFILE_MODULE = 'aaa.BBB'
then I will go to the django shell and print
>>> from django.contrib.auth.models import User
>>> a=User.objects.get(id=1)
>>> a.get_profile()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/contrib/auth/models.py", line 373, in get_profile
self._profile_cache = model._default_manager.using(self._state.db).get(user__id__exact=self.id)
File "/usr/local/lib/python2.6/dist-packages/Django-1.2.5-py2.6.egg/django/db/models/query.py", line 347, in get
% self.model._meta.object_name)
DoesNotExist: BBB matching query does not exist.
In some body there is an idea what is wrong? Edit: I am doing manage.py syncdb
source
share