<s> from django . contrib . auth import authenticate , login as _login <EOL> from django . http import HttpResponseRedirect <EOL> from django . views . generic import DetailView <EOL> from . models import RecProduct <EOL> def login ( request ) : <EOL> username = request . POST [ '<STR_LIT:username>' ] <EOL> password = request . POST [ '<STR_LIT:password>' ] <EOL> user = authenticate ( username = username , password = password ) <EOL> if user is not None : <EOL> if user . is_active : <EOL> _login ( request , user ) <EOL> else : <EOL> pass <EOL> else : <EOL> pass <EOL> return HttpResponseRedirect ( request . POST . get ( '<STR_LIT>' , '<STR_LIT:/>' ) ) <EOL> class RecProductView ( DetailView ) : <EOL> model = RecProduct </s>
