简体   繁体   English

djnago-admin如何在django-admin界面添加额外的Fields注册

[英]Djnago-admin how to add extra Fields registrations in django-admin interface

In my web application, only the admin can register a user.在我的 web 应用中,只有 admin 可以注册用户。 I need to add extra fields to the registration form only in the djnago-admin interface, how can I do it, please?我只需要在 djnago-admin 界面中向注册表单添加额外的字段,请问我该怎么做?

You can done this by overriding fieldsets and add_feildsets in admin.py file [You can check here how to override these fields in admin.py file]您可以通过覆盖 admin.py 文件中的字段集和 add_feildsets 来完成此操作 [您可以在此处查看如何覆盖 admin.py 文件中的这些字段]

https://docs.djangoproject.com/en/4.1/topics/auth/customizing/#a-full-example https://docs.djangoproject.com/en/4.1/topics/auth/customizing/#a-full-example

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM