【发布时间】:2018-04-07 08:07:42
【问题描述】:
我已经尝试了针对类似问题找到的解决方案,但没有一个对我有用。
我正在使用 Angular 前端 + DRF + Django Rest Auth,对于确认 url,我可以通过添加一个看起来像这样的自定义适配器来覆盖它以指向我的前端,
class AccountAdapter(DefaultAccountAdapter):
def send_mail(self, template_prefix, email, context):
context['activate_url'] = settings.URL_FRONT + \
'access/verify-email/' + context['key']
msg = self.render_mail(template_prefix, email, context)
msg.send()
使用URL_FRONT = 'http://localhost:8080/app/#/' 作为将用户引导至客户端的设置。
我的问题是对密码重置 URL 实施相同的操作。我希望它以URL_FRONT 设置开始,并附加了我所拥有的用于确认的令牌。
解决此问题的最佳方法是什么?
【问题讨论】:
-
重置密码现在显示在哪里?
-
它显示了 django 站点的 url。所以在localhost上,它是
localhost:8000,我希望它显示http://localhost:8080/app/#/作为url
标签: angularjs django django-rest-framework