如何自定义django-registration(传递参数,使用其他内置形式)
我是 django 和 python 的新手。然而,我已经成功构建了应用程序的一小部分,并且我现在想要添加用户注册功能。
我已经下载并安装了 django-administration,到目前为止,我对基本和默认配置印象深刻。 但是在尝试自定义它的一些行为后,我现在被困了 3 个小时。
如何更改 success_url?
我该如何使用RegistrationFormTermsOfService()?
这些文档使它听起来如此简单,但对于像我这样的新手来说却陷入困境和沮丧。它太模糊了,对新人的假设太多。
谁能向我展示一个关于如何执行此操作的非常简单的示例?要编辑哪些文件等。
任何回复将不胜感激,因为我在过去的几个小时里一直在努力解决这个问题。
问候, 温伯特
I a new to django and python. I have however managed to build a small part of my application and I am in the point where I want to add a user registration feature.
I have downloaded and installed django-administration and so far I have been impressed with the basic and default configuration. BUT upon trying to customize some of it's behaviour I am stuck for 3 hours now.
How do I go about changing the success_url?
How do I go about using RegistrationFormTermsOfService()?
The docs make it sound so easy but for a newbie like I am stuck and frustrated. It is too vague and assumes too much from newcomers.
Can anyone show me a very quick example on how to do this? What files to edit, etc.
Any reply would be greatly appreciated as I have been trying to figure this out for the last few hours.
Regards,
Wenbert
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 django-registration FAQ
如何将自定义参数传递给视图?
官方 Django 教程的第 3 部分在介绍通用视图时涵盖了必要的机制:只需在 URLconf 中提供关键字参数的字典即可。
From django-registration FAQ
How do I pass custom arguments to the views?
Part 3 of the official Django tutorial, when it introduces generic views, covers the necessary mechanism: simply provide a dictionary of keyword arguments in your URLconf.