from django.shortcuts import render, redirect, Http404
from django.template import TemplateDoesNotExist
from django.conf import settings


def render_template(request, path):
    if path and settings.APPEND_SLASH and not path.endswith('/'):
        return redirect(request.path + '/')
    templates = ['%s.html' % path.rstrip('/'), '%sindex.html' % path]
    try:
        return render(request, templates, {'request': request})
    except TemplateDoesNotExist:
        raise Http404('%s can not be found' % request.path)

3ff0e39f5250252f0afa09f698e857e5c0959456
<mask token>

<mask token>


def render_template(request, path):
    if path and settings.APPEND_SLASH and not path.endswith('/'):
        return redirect(request.path + '/')
    templates = ['%s.html' % path.rstrip('/'), '%sindex.html' % path]
    try:
        return render(request, templates, {'request': request})
    except TemplateDoesNotExist:
        raise Http404('%s can not be found' % request.path)

from django.shortcuts import render, redirect, Http404
from django.template import TemplateDoesNotExist
from django.conf import settings


def render_template(request, path):
    if path and settings.APPEND_SLASH and not path.endswith('/'):
        return redirect(request.path + '/')
    templates = ['%s.html' % path.rstrip('/'), '%sindex.html' % path]
    try:
        return render(request, templates, {'request': request})
    except TemplateDoesNotExist:
        raise Http404('%s can not be found' % request.path)
