I'm a newbie in Python and Django, so please bear with me. The project I'm hacking on was not made by me so I'm fumbling in the dark.
When new users are created they do not have permission to things like user.has_perm('places.add_place')
and there are no relation to the users id in the PostgreSQL table auth_permissions
which I guess is the symptom.
If I manage.py flush --settings=settings.jacob
I get:
Error: One or more models did not validate:
users.userprofile: "uuid": Primary key fields cannot have null=True.
places.category: "uuid": Primary key fields cannot have null=True.
places.image: "uuid": Primary key fields cannot have null=True.
places.masterplace: "uuid": Primary key fields cannot have null=True.
places.place: "uuid": Primary key fields cannot have null=True.
If I look at the table places_masterplace
I see Primary key <no primary key>
whereas a table like users_userprofile
do have one.
We use Django==1.4.1
and South==0.7.6
.
We only have this problem on our staging server.
Could this be a local database problem, or would a deploy to production also cause it there?
The problem was an outcommented line in settings which was now needed due to an upgraded version of django-social-auth.
'django.contrib.auth.backends.ModelBackend',