text: from django.shortcuts import render, redirect
  from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
  from django.contrib.auth import login, logout
  
  
  def signin(request):
      if request.method == 'POST':
          form = AuthenticationForm(data=request.POST)
          if form.is_valid():
              user = form.get_user()
              login(request, user)
              return redirect('story:index')
      else:
          form = AuthenticationForm()
          return render(request, 'accounts/signin.html', {'form': form})
  
  
  def signup(request):
      if request.method == 'POST':
          form = UserCreationForm(request.POST)
          if form.is_valid():
              user = form.save()
              login(request, user)
              return redirect('story:index')
      else:
          form = UserCreationForm()
          return render(request, 'accounts/signup.html', {'form': form})
  
  
  def signout(request):
      logout(request)
      return redirect('home')
  