from django.shortcuts import render
from django.http import HttpResponse


def join_us(request):
    return render(
            request,
            'users/joinus.html',
            context={}
            )

@@ -28,16 +28,26 @@
 t render
+, redirect
 %0Afrom dj
@@ -81,31 +81,99 @@
 se%0A%0A
-%0Adef join_us(request):%0A
+from users.models import User%0A%0A%0Adef join_us(request):%0A%0A    if request.method == %22GET%22:%0A    
     
@@ -199,16 +199,20 @@
         
+    
 request,
@@ -212,16 +212,20 @@
 equest,%0A
+    
         
@@ -261,16 +261,20 @@
         
+    
 context=
@@ -276,16 +276,550 @@
 text=%7B%7D%0A
+                )%0A%0A    elif request.method == %22POST%22:%0A        username = request.POST.get(%22username%22)%0A        phone = request.POST.get(%22phone%22)%0A        password = request.POST.get(%22password%22)%0A%0A        created_user = User.objects.create_user(%0A                username=username,%0A                password=password,%0A                phone=phone,%0A                )%0A%0A        return redirect(%0A                render(%0A                    request,%0A                    'users/home.html',%0A                    context=%7B%7D%0A                    )%0A    
         

update : add join_us.view POST request