如何使用django-postman为每个用户提供发送消息的能力
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Python 路径上提供 django-postman 后,您需要将其添加到
INSTALLED_APPS
列表中并进行初始配置。目前,这仅提供基于管理员的消息访问权限。将
(r'^messages/', include('postman.urls')),
添加到根 URLurls.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 URLurls.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.
您必须确保
settings.py
中的POSTMAN_AUTO_MODERATE_AS = True
。您在评论中提到您已经这样做了,但您的问题类似于我最初的障碍,这解决了它。其他人可能面临同样的情况。旧消息仍会在数据库中标记为未审核,因此您可能需要尝试发送新消息才能生效。
You must make sure that
POSTMAN_AUTO_MODERATE_AS = True
insettings.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.
我将其放在这里是因为其他人可能也遇到同样的问题...
从管理区域发送消息时,消息会自动列为“待处理”,因此即使 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.