如何使用django-postman为每个用户提供发送消息的能力

发布于 2024-12-21 20:20:48 字数 182 浏览 1 评论 0原文

我正在尝试使用 django-postman 并且我已成功将其与我的项目集成。我想使用这个应用程序让每个用户能够向其他用户发送消息。

任何人都可以指出我做这件事的正确方向吗?

I am trying to use django-postman and I have successfully integrated it with my project. I want to use this application to give each user the ability to send messages to other users.

Can anybody point me in the right direction to do this thing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

只有影子陪我不离不弃 2024-12-28 20:20:48

在 Python 路径上提供 django-postman 后,您需要将其添加到 INSTALLED_APPS 列表中并进行初始配置。目前,这仅提供基于管理员的消息访问权限。

(r'^messages/', include('postman.urls')), 添加到根 URL urls.py 配置中的模式将挂钩 django-postman查看您的项目,用户将能够访问那里的消息界面。

请务必查看官方文档了解更多详细信息。

After you make django-postman available on the Python path, you'll need to add it to the list of INSTALLED_APPS and initially configure it. For the time being, that will only provide with admin-based access to messages.

Adding (r'^messages/', include('postman.urls')), to your patterns in the root URL urls.py configuration will hook the django-postman views into your project and users will be able to access the messages interface there.

Make sure to have a look at the official documentation for more details.

罗罗贝儿 2024-12-28 20:20:48

您必须确保 settings.py 中的 POSTMAN_AUTO_MODERATE_AS = True。您在评论中提到您已经这样做了,但您的问题类似于我最初的障碍,这解决了它。其他人可能面临同样的情况。

旧消息仍会在数据库中标记为未审核,因此您可能需要尝试发送新消息才能生效。

You must make sure that POSTMAN_AUTO_MODERATE_AS = True in settings.py. You mention in the comments that you have done so, but your problem resembles my initial hurdle and this fixed it. Others may face the same situation.

Old messages will still be marked as unmoderated in the database, so you may need to try to send new messages before it works.

满栀 2024-12-28 20:20:48

我将其放在这里是因为其他人可能也遇到同样的问题...

  • 从管理区域发送消息时,消息会自动列为“待处理”,因此即使 POSTMAN_AUTO_MODERATE_AS = True,也不会发送消息(从 当从管理

  • 当从“用户”(从“站点”而不是“管理”区域)发送消息时,当 POSTMAN_AUTO_MODERATE_AS = True 时,消息将自动被接收者接受。

I am putting this here because others may be having the same issue...

  • When sending messages from the admin area, messages are automatically listed as "pending" so even if POSTMAN_AUTO_MODERATE_AS = True, the message will not be sent (from admin).

  • When sending messages from a 'user' (from the 'site' & not 'admin' area), when POSTMAN_AUTO_MODERATE_AS = True, the message will automatically be accepted by the receiver.

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