Django-Registration Activation redirect with django.contrib.messages

后端 未结 2 1273
离开以前
离开以前 2021-01-14 19:38

I\'m trying to set up my django-registration activation workflow so that when the user hits the activation link it redirects them to the login page with a nice little messag

2条回答
  •  悲哀的现实
    2021-01-14 19:57

    Django-registration is using signals to hook on some points. In your case it should be something like:

    from registration import signals
    def register_handler(request, **kwargs):
        messages.success(request, 'Thank you!')
    signals.user_registered.connect(register_handler)
    

提交回复
热议问题