如何自定义django-registration(传递参数,使用其他内置形式)

发布于 2024-09-11 05:09:35 字数 468 浏览 1 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一腔孤↑勇 2024-09-18 05:09:35

来自 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文