Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User(models.Model):
- email = models.EmailField()
- password = models.CharField(max_length=200)
- client_id = models.IntegerField()
- role = models.CharField(max_length=200)
- url(r'^admin/', admin.site.urls),
- url(r'^main/$', MainPage, name="main"),
- url(r'^login/$', UserLogin, name="login"),
- url(r'^$', HomeView, name="home"),
- url(r'^logout/$', Logout, name="logout"),
- def UserLogin(request):
- email = request.POST.get('email',False)
- password = request.POST.get('password',False)
- user = authenticate(email=email,password=password)
- if user is not None:
- return HttpResponseRedirect('Main.html')
- else:
- return HttpResponseRedirect('Index.html')
- def Logout(request):
- auth.logout(request)
- return render_to_response('Login.html')
- <form class="m-t" role="form" action="/login" method="post">
- <div class="form-group">
- <input type="email" class="form-control" placeholder="Username" required="">
- </div>
- <div class="form-group">
- <input type="password" class="form-control" placeholder="Password" required="">
- </div>
- <button type="submit" class="btn btn-primary block full-width m-b">Login</button>
- <a href="password.html">
- <small>Forgot password?</small>
- </a>
- <a class="btn btn-sm btn-white btn-block" href="reg.html">Create an account</a>
- </form>
Add Comment
Please, Sign In to add comment