<commit_before>from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from django.shortcuts import render
from django.contrib import auth
from django.http import HttpResponseRedirect


@api_view(('GET',))
def root_route(request, format=None):
    return Response({
        'bucketlists': reverse(
            'bucketlist-list',
            request=request,
            format=format
        ),
    })


def custom_404(request):
    return render(request, '404.html')


def landing(request):
    return render(request, 'landing.html')


def dashboard(request):
    return render(request, 'dashboard.html')

<commit_msg>(feature) Implement redirects<commit_after>from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
from django.shortcuts import render
from django.contrib import auth
from django.http import HttpResponseRedirect


@api_view(('GET',))
def root_route(request, format=None):
    return Response({
        'bucketlists': reverse(
            'bucketlist-list',
            request=request,
            format=format
        ),
    })


def custom_404(request):
    return render(request, '404.html')


def landing(request):
    if request.user.is_authenticated():
        return render(request, 'dashboard.html')
    return render(request, 'landing.html')


def dashboard(request):
    if request.user.is_authenticated():
        return render(request, 'dashboard.html')
    return HttpResponseRedirect("/")


{'fraction_non_alphanumeric': 0.0979772439949431, 'fraction_numerical': 0.007585335018963337, 'mean_word_length': 3.826219512195122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3567050', 'n_tokens_mistral': 439, 'n_tokens_neox': 419, 'n_words': 111}