djoser

Djoser for DRF with Knox tokens

十年热恋 提交于 2021-02-19 05:21:29
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

别来无恙 提交于 2021-02-19 05:21:28
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

柔情痞子 提交于 2021-02-19 05:21:11
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

萝らか妹 提交于 2021-02-19 05:20:13
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

How to use a different domain for Djoser email?

☆樱花仙子☆ 提交于 2021-02-11 13:47:40
问题 How can I change the domain the link inside the email djoser sends uses? 回答1: I figured this out, to change the link domain you need to add DOMAIN and SITE_NAME to your project settings. Example: DOMAIN = config('DOMAIN') #example.com SITE_NAME = config('SITE_NAME') #Example DJOSER = { 'LOGIN_FIELD':'email', 'USER_CREATE_PASSWORD_RETYPE':True, 'ACTIVATION_URL': '/users/activate/{uid}/{token}', 'SEND_ACTIVATION_EMAIL': True, 'SERIALIZERS':{ 'user_create':'userauth.serializers

How do I explicitly specify language of email I want to send?

倾然丶 夕夏残阳落幕 提交于 2021-01-27 13:17:23
问题 I have a custom user model that have a preferred_language field. I want all the emails (activation and password reset) to be sent translated to the language that user specified in profile. class CustomUser(AbstractBaseUser, PermissionsMixin): ... LANGUAGE_CHOICES = ( (1, "English"), (2, "Русский") ) preferred_language = models.PositiveSmallIntegerField(choices=LANGUAGE_CHOICES, default=2, verbose_name=_("Preferred language")) I thought about setting custom email class but didn't saw in navive

Accounts activation with Djoser and Django Rest Framework

好久不见. 提交于 2020-03-22 09:11:42
问题 Am using Djoser for authentication in my project. Have been struggling to add email activation for over 4 days now but seems have failed to grab it fine as the documentation is a little hard for me to understand. This is my code settings.py #change auth model to custom model AUTH_USER_MODEL = 'userauth.User' #setting up email server EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'okumujustine01@gmail.com' EMAIL_HOST_PASSWORD =

password reset implementation with djoser

∥☆過路亽.° 提交于 2019-12-25 01:04:02
问题 I wanted to use djoser for the reset password functionality and as per the documentation: PASSWORD_RESET_CONFIRM_URL URL to your frontend password reset page. It should contain {uid} and {token} placeholders, e.g. #/password-reset/{uid}/{token} . You should pass uid and token to reset password confirmation endpoint. I have done the following: PASSWORD_RESET_CONFIRM_URL': 'reset/password/reset/confirm/{uid}/{token}', url url(r'^reset/password/reset/confirm/(?P<uid>[\w-]+)/(?P<token>[\w-]+)/$',