ungleich-ipv6only/returnok/views.py
Nico Schottelius 32e153801e Feature complete!
Maybe some renaming/refactoring later
2018-12-24 17:51:50 +01:00

13 lines
382 B
Python

import pyotp
import json
from django.http import HttpResponse
from django.conf import settings
def index(request):
answer = {}
answer['token'] = pyotp.TOTP(settings.UNGLEICHOTP['UNGLEICHOTPSEED']).now()
answer['name'] = settings.UNGLEICHOTP['UNGLEICHOTPNAME']
answer['realm'] = settings.UNGLEICHOTP['UNGLEICHOTPREALM']
return HttpResponse(json.dumps(answer))