Привет, я тебе скину некоторые файлы из своего проекта. Твоя задача сделать подсветку синтаксиса кода питона на странице snippets/{id}.

views.py:
import datetime

from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.shortcuts import render, redirect

from main.forms import LoginForm, AddSnippetForm
from main.models import Snippet


def get_base_context(request, pagename):
    return {
        'pagename': pagename,
        'loginform': LoginForm(),
        'user': request.user,
    }


def index_page(request):
    context = get_base_context(request, 'PythonBin')
    if "snippet_id" in request.GET:
        snippet_id = request.GET.get('snippet_id')
        return redirect('view_snippet', id=snippet_id)
    return render(request, 'pages/index.html', context)


def add_snippet_page(request):
    context = get_base_context(request, 'Добавление нового сниппета')
    if request.method == 'POST':
        addform = AddSnippetForm(request.POST)
        if addform.is_valid():
            if request.user.is_authenticated:
                uuser = request.user
            else:
                uuser = None
            record = Snippet(
                name=addform.cleaned_data['name'],
                code=addform.cleaned_data['code'],
                creation_date=datetime.datetime.now(),
                user=uuser,
            )
            record.save()
            id = record.id
            messages.add_message(request, messages.SUCCESS, "Сниппет успешно добавлен")
            return redirect('view_snippet', id=id)
        else:
            messages.add_message(request, messages.ERROR, "Некорректные данные в форме")
            return redirect('add_snippet')
    else:
        if request.user.is_authenticated:
            user = request.user.username
        else:
            user = 'AnonymousUser'
        
        context['addform'] = AddSnippetForm(
            initial={
                'user': user,
            }
        )
    return render(request, 'pages/add_snippet.html', context)


def view_snippet_page(request, id):
    context = get_base_context(request, 'Просмотр сниппета')
    try:
        if request.user.is_authenticated:
            user = request.user.username
        else:
            user = 'AnonymousUser'

        record = Snippet.objects.get(id=id)
        context['addform'] = AddSnippetForm(
            initial={
                'user': user,
                'name': record.name,
                'code': record.code,
            }
        )
    except Snippet.DoesNotExist:
        raise Http404
    return render(request, 'pages/view_snippet.html', context)


def login_page(request):
    if request.method == 'POST':
        loginform = LoginForm(request.POST)
        if loginform.is_valid():
            username = loginform.data['username']
            password = loginform.data['password']
            user = authenticate(request, username=username, password=password)
            if user is not None:
                login(request, user)
                messages.add_message(request, messages.SUCCESS, "Авторизация успешна")
            else:
                messages.add_message(request, messages.ERROR, "Неправильный логин или пароль")
        else:
            messages.add_message(request, messages.ERROR, "Некорректные данные в форме авторизации")
    return redirect('index')


def logout_page(request):
    logout(request)
    messages.add_message(request, messages.INFO, "Вы успешно вышли из аккаунта")
    return redirect('index')


def my_snippets_page(request):
    raise NotImplementedError


view_snippet.html:
{% extends 'base.html' %}

{% block extra_css %}
<style>
    textarea {
        font-family:monospace;
    }
</style>
{% endblock %}

{% block content %}
<div class="row">
    <div class="col">
        <form>
            <fieldset disabled>
                <div class="form-group row">
                    <div class="col col-8">
                        {{ addform.name.label }}: {{ addform.name }}
                    </div>
                    <div class="col col-4">
                        {{ addform.user.label }}: {{ addform.user }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col">
                        {{ addform.code.label }}: {{ addform.code }}
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
</div>

{% endblock %}

base.html:
{% load static %}

<!doctype html>
<html lang="en" class="h-100">

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="shortcut icon" type="image/png" href="{% static 'images/logo.png' %}"/>
        <link rel="shortcut icon" type="image/png" href="{% static 'images/logo.png' %}"/>
        <title>PythonBin</title>

        {% block base_css %}
        <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
        <link rel="stylesheet" href="{% static 'css/sticky-footer-navbar.css' %}">
        {% endblock %}

        {% block extra_css %}

        {% endblock %}
    </head>

    <body class="d-flex flex-column h-100">

        <header>
            {% block header %}
                {% include 'header.html' %}
            {% endblock %}
        </header>

        <main role="main" class="mt-3 flex-shrink-0">
            <div class="container">
                {% include 'messages.html' %}

                {% block pagename %}
                <div class="row">
                    <div class="col">
                        <h1>{{ pagename }}</h1><hr>
                    </div>
                </div>
                {% endblock %}

                {% block content %}

                {% endblock %}
            </div>
        </main>

        <footer class="footer mt-auto py-3">
            {% block footer %}
                {% include 'footer.html' %}
            {% endblock %}
        </footer>

        <script src="{% static 'js/jquery-3.3.1.slim.min.js' %}"></script>
        <script src="{% static 'js/popper.min.js' %}"></script>
        <script src="{% static 'js/bootstrap.min.js' %}"></script>
    </body>

</html>


urls.py:
"""prom_sem_kr URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

from main import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.index_page, name='index'),
    path('snippets/add', views.add_snippet_page, name='add_snippet'),
    path('snippets/list', views.my_snippets_page, name='my_snippets'),
    path('snippets/<int:id>', views.view_snippet_page, name='view_snippet'),
    path('login/', views.login_page, name='login'),
    path('logout/', views.logout_page, name='logout'),
]


Если тебе нужны дополнительные файлы, то скажи мне и я тебе отправлю их код.