From 3c86fd9abb9fd0d3db7ef4132db9f5a5ad089526 Mon Sep 17 00:00:00 2001 From: cbomprezzi Date: Mon, 15 Jun 2020 18:27:57 +0200 Subject: [PATCH] add drf login/logout/registration/user customization --- demo/templates/rest_framework/api.html | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 demo/templates/rest_framework/api.html diff --git a/demo/templates/rest_framework/api.html b/demo/templates/rest_framework/api.html new file mode 100644 index 0000000..57f02c9 --- /dev/null +++ b/demo/templates/rest_framework/api.html @@ -0,0 +1,52 @@ +{% extends "rest_framework/base.html" %} + +{% block style %} + {{ block.super }} + +{% endblock %} + +{% block userlinks %} + {% if user.is_authenticated or response.data.access_token %} + + {% else %} + {% url 'rest_login' as login_url %} +
  • Login
  • + {% url 'rest_register' as register_url %} +
  • Register
  • + {% endif %} +{% endblock %}