from django.shortcuts import render, HttpResponseRedirect
from django.contrib.auth import authenticate, login
class AccountViews:
def __init__(self, request=None, user=None, username=None, password=None):
self.request = request
self.username = username
self.password = password
self.user = user
def account(self):
return HttpResponseRedirect("/")
def login(self):
self.username = self.request.POST['username']
self.password = self.request.POST['password']
self.user = authenticate(self.request, username=self.username, password=self.password)
if self.user is not None:
login(self.request, self.user)
return HttpResponseRedirect("/")
def register(self):
pass