title: User signup leads to IntegrityError
body: <p>After a user signs up, the following IntegrityError is displayed:</p>
  
  <pre><code>IntegrityError at /users/signup
  (1062, "Duplicate entry '1' for key 2")
  </code></pre>
  
  <p>Even though the user gets an error, he can log in regularly. The User gets created, along with the UserProfile.</p>
  
  <p>Here is the /users/signup view that causes the error:</p>
  
  <pre><code>def signup(request):
    signup_form = SignupForm(request.POST)
    #goal = request.POST.get('goal')
    goal = None
    if signup_form.is_valid():
      username = signup_form.cleaned_data['username']
      email = signup_form.cleaned_data['email']
      password = signup_form.cleaned_data['password']
      user = User.objects.create_user(username, email, password)
      user = authenticate(username=username, password=password)
      login(request, user)
      return HttpResponseRedirect("/")
    else:
      return render_to_response("authorize.html", {'signup_form': signup_form, 'goal': goal}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>Here is my /user/models.py:</p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  from django.db.models.signals import post_save
  from main.models import Goal
  
  class UserProfile(models.Model):
    user = models.OneToOneField(User)
    joined_goals = models.ManyToManyField(Goal, related_name="joined_goals")
    followingGoals = models.ManyToManyField(Goal, related_name="following_goals")
  
    def __unicode__(self):
      return self.user.username
  
    def get_goals(self):
      try:
        goals = Goal.objects.filter(user=self.user)
        return goals
      except Goal.DoesNotExist:
        return []
  
  def create_user_profile(sender, instance, created, **kwargs):
    if created:
      userProfile = UserProfile.objects.create(user=instance)
  
  post_save.connect(create_user_profile, sender=User)
  </code></pre>
  
  <p>I've dropped all of the tables in my MySQL database multiple times and run python manage.py syncdb, but I still get the same error everytime after creating a new user.</p>
  
  <p>Edit: I do not get this error on my localhost, only on my remote host. I use sqlite on my localhost and mysql on my remote host.</p>