from datetime import datetime, timedelta
import jwt
import os


from django.shortcuts import render
from django.conf import settings
from django.views.generic.base import TemplateView


key = os.path.join(
    os.path.dirname(__file__),
    'ecc',
    'key.pem',
)
with open(key, 'r') as fh:
    ecc_private = fh.read()


# Create your views here.
class NabuView(TemplateView):
    template_name = 'chat/nabu.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)

        data = {
            'sub': 'Kromey',
            'iss': self.request.headers['Host'],
            'aud': self.request.headers['Host'],
            'exp': datetime.utcnow() + timedelta(seconds=30),
        }
        token = jwt.encode(data, ecc_private, algorithm='ES256')
        context['token'] = token.decode('utf-8')

        return context


@@ -576,32 +576,31 @@
 : se
-lf.request.headers%5B'Host
+ttings.NABU%5B'jwt'%5D%5B'iss
 '%5D,%0A
@@ -624,32 +624,31 @@
 : se
-lf.request.headers%5B'Host
+ttings.NABU%5B'jwt'%5D%5B'aud
 '%5D,%0A
@@ -700,18 +700,37 @@
 lta(
-seconds=30
+**settings.NABU%5B'jwt'%5D%5B'exp'%5D
 ),%0A 

Use Nabu settings in token generation