from django.http import HttpResponse
from django.core.management import call_command
import io
def fix_db_view(request):
out = io.StringIO()
try:
call_command('migrate', 'core', stdout=out)
return HttpResponse(f"SUCCESS: Database updated.
{out.getvalue()}{out.getvalue()}")