from django.shortcuts import render

from .models import Document


def documents(request):
    docs = Document.objects.all().order_by("title")
    return render(request, 'home.html', {'documents': docs})

from django.contrib.auth.decorators import login_required
from django.shortcuts import render

from .models import Document


@login_required
def documents(request):
    docs = Document.objects.all().order_by("title")
    return render(request, 'home.html', {'documents': docs})

Add required login to maedchenbund
Add required login to maedchenbund

+ from django.contrib.auth.decorators import login_required
  from django.shortcuts import render
  
  from .models import Document
  
  
+ @login_required
  def documents(request):
      docs = Document.objects.all().order_by("title")
      return render(request, 'home.html', {'documents': docs})
  
Add required login to maedchenbund
## Code Before:
from django.shortcuts import render

from .models import Document


def documents(request):
    docs = Document.objects.all().order_by("title")
    return render(request, 'home.html', {'documents': docs})

## Instruction:
Add required login to maedchenbund
## Code After:
from django.contrib.auth.decorators import login_required
from django.shortcuts import render

from .models import Document


@login_required
def documents(request):
    docs = Document.objects.all().order_by("title")
    return render(request, 'home.html', {'documents': docs})
