Example #1
0
def sign_up(request):
    form = CreateNewUser()
    registered = False
    if request.method == 'POST':
        form = CreateNewUser(request.POST)
        if form.is_valid():
            user = form.save()
            registered=True
            user_profile = UserProfile(user=user)
            user_profile.save() #user profile's instance of model
            return HttpResponseRedirect(reverse('App_Login:login'))
    return render(request, 'App_Login/sign_up.html', context={'title':'signup . Instagram', 'form':form})
Example #2
0
def sign_up(request):
    form = CreateNewUser()
    registered = False
    if request.method == 'POST':
        form = CreateNewUser(data=request.POST)
        if form.is_valid():
            user = form.save()
            registered = True
            user_profile = UserProfile(user=user)
            user_profile.save()
            return HttpResponseRedirect(reverse('App_Login:login'))
    return render(request,
                  'Login_App/signup.html',
                  context={
                      'title': 'Sign up . Social',
                      'form': form
                  })
Example #3
0
 class Meta:
     model = UserProfile()
     exclude = ('user', )
Example #4
0
 class Meta:
     model = UserProfile()
     #exclude = ('user',)
     fields = "__all__"