From 3c86fd9abb9fd0d3db7ef4132db9f5a5ad089526 Mon Sep 17 00:00:00 2001 From: cbomprezzi Date: Mon, 15 Jun 2020 18:27:57 +0200 Subject: [PATCH 1/2] 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 %} From bea6e3d229d615568db597f77b4cffc4b768120a Mon Sep 17 00:00:00 2001 From: cbomprezzi Date: Mon, 15 Jun 2020 19:28:23 +0200 Subject: [PATCH 2/2] aligned requirements to tox.ini --- demo/requirements.pip | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/requirements.pip b/demo/requirements.pip index e9276aa..4a0061a 100644 --- a/demo/requirements.pip +++ b/demo/requirements.pip @@ -1,5 +1,5 @@ -django>=1.9.0 -git+https://github.com/jazzband/dj-rest-auth.git@master +django>=2.2 +dj-rest-auth @ git+https://github.com/jazzband/dj-rest-auth.git@master djangorestframework>=3.11.0 djangorestframework-simplejwt==4.4.0 django-allauth>=0.24.1