from django.shortcuts import render
from django.http import HttpResponse

def dashboard(request):
    return HttpResponse('SUCCESS!')

from django.shortcuts import render
from django.http import HttpResponse

def dashboard(request):
    context = {}
    if request.user.is_authenticated:
        context['databases'] = request.user.database_set.all()
    return render(request, 'databases/dashboard.html', context)

Add databases to dashboard context
Add databases to dashboard context

  from django.shortcuts import render
  from django.http import HttpResponse
  
  def dashboard(request):
-     return HttpResponse('SUCCESS!')
+     context = {}
+     if request.user.is_authenticated:
+         context['databases'] = request.user.database_set.all()
+     return render(request, 'databases/dashboard.html', context)
  
Add databases to dashboard context
## Code Before:
from django.shortcuts import render
from django.http import HttpResponse

def dashboard(request):
    return HttpResponse('SUCCESS!')

## Instruction:
Add databases to dashboard context
## Code After:
from django.shortcuts import render
from django.http import HttpResponse

def dashboard(request):
    context = {}
    if request.user.is_authenticated:
        context['databases'] = request.user.database_set.all()
    return render(request, 'databases/dashboard.html', context)
