**Go to edit 2**

Calling the following adduser function in views.py. I save the user first because it's id (automatically created by Django upon INSERT) is the primary/foreign key for accounts and passwords. Adding a user seems to be working fine, but then when it gets to the `Accounts(user=u)`, the following error throws: 

```
IntegrityError at /adduser
insert or update on table "OmniCloud_App_accounts" violates foreign key constraint "user_id_refs_id_468fbcec324e93d2"
DETAIL:  Key (user_id)=(4) is not present in table "OmniCloud_App_user".

```

But the key should be there since it just saved the user to the db...

```
def adduser(request):
    username = request.POST['username']
    password = request.POST['password']
    u = User.objects.create_user(username, request.POST['email'], password)
    u.save()
    a = Accounts(user=u)
    p = Passwords(user=u)
    a.save()
    p.save()
    user = authenticate(username=username, password=password)
    if user is not None and user.is_active:
        auth.login(request, user)
        return HttpResponseRedirect("/%s/" %u.id)
    else:
        return HttpResponseRedirect("/account/invalid/")

```

EDIT: Here is the beginning to the initialization of Accounts:

```
from django.db import models
from django.contrib.auth.models import User
class Accounts(models.Model):   
    user = models.ForeignKey(User)

```

***EDIT 2***
I've realized, by going to the admin page, that when It complains that 4 isn't in the database, that is because it is adding the 3rd user. Adding the 4th user throws an error that there is no user with id 5 (duh). I don't see anything in the code that would cause it to search for user\_id+1, any ideas

To the war chest!