ホームビューに転送されているため、このビューに由来すると思います(以下を参照)。
@login_required
def HomePage(request):
if request.user.get_profile().phone == "":
return HttpResponseRedirect('/phone')
else:
add_list = add.objects.all()
ctx = {'last_login':request.session.get('social_auth_login_backend')}
return render_to_response("homepage.html", {'add_list': add_list, 'ctx':ctx}, context_instance=RequestContext(request))
そしてモデル:
class customuser(models.Model):
last_login = models.DateTimeField(blank=True, null=True)
is_active = models.BooleanField()
nickname = models.CharField(max_length=255)
regdate = models.DateField(auto_now=True)
phone = models.CharField(max_length=255)
user = models.OneToOneField(User)
city = models.ForeignKey(locations, null=True)
def __str__(self):
return "%s user " % self.user
def create_user_profile(sender, instance, created, **kwargs):
if created:
profile, created = customuser.objects.get_or_create(user=instance)
post_save.connect(create_user_profile, sender=User)
class Admin:
pass