i have a html template which i want to use for authentication in django. I am using pymongo to connect to remote mongodb and fetch_data. The remote mongodb has a collection which has username & password for a demo user. I read that django has a inbuilt authentication module but i dont want to use that.
My template :
<form action="/index.html">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
<input type="text" class="form-control" placeholder="Username">
</div>
</div>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
<input type="password" class="form-control" placeholder="Password">
</div>
</div>
<div class="row">
<div class="col-xs-8 text-left checkbox">
<label class="form-checkbox form-icon">
<input type="checkbox"> Remember me
</label>
</div>
<div class="col-xs-4">
<div class="form-group text-right">
<button class="btn btn-success text-uppercase" type="submit">Sign In</button>
</div>
</div>
</div>
</form>
How can i pass data from my template to my views.py file? Currently I am not using any authentication.
my views.py:
from django.shortcuts import render
from django.http import HttpResponse
def login(request):
return render(request, 'login/login.html')
In Pymongo, I can use command db.getCollection('users').find({'email':'%s'}) {{email}} to pass email and verify.
PS: Most tutorial i read were about django's inbuilt authentication.