python - Django Postman 实现发送消息

标签 python django django-urls django-messages

我正在尝试使用 Django-Postman 框架在 Django 2.0 中的用户之间发送消息。 我已经安装了该应用程序并进行了必要的更改,如上所述 in the docs of the framework .

但是,当我尝试访问消息网址时,我得到一个空白页面(如此屏幕截图):

blank page

这是我到目前为止所做的:

  1. 已安装django-postman
  2. settings.py

    INSTALLED_APPS = [
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.messages',
        'django.contrib.staticfiles',
        'postman',
        'account',
        'cart',
        'shop',
        'landingpage',
    ]
    POSTMAN_I18N_URLS = True  # default is False
    POSTMAN_DISALLOW_ANONYMOUS = True  # default is False
    POSTMAN_DISALLOW_MULTIRECIPIENTS = True  # default is False
    POSTMAN_DISALLOW_COPIES_ON_REPLY = True  # default is False
    POSTMAN_DISABLE_USER_EMAILING = True  # default is False
    POSTMAN_FROM_EMAIL = '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b3d5c1dcdef3dbdcc0c79dc7dfd7" rel="noreferrer noopener nofollow">[email protected]</a>'  # default is DEFAULT_FROM_EMAIL
    POSTMAN_AUTO_MODERATE_AS = True  # default is None
    POSTMAN_SHOW_USER_AS = 'get_full_name'  # default is None
    POSTMAN_NAME_USER_AS = 'last_name'  # default is None
    POSTMAN_QUICKREPLY_QUOTE_BODY = True  # default is False
    POSTMAN_NOTIFIER_APP = None  # default is 'notification'
    POSTMAN_MAILER_APP = None  # default is 'mailer'
    
  3. 我已经在urls.py中以这种方式链接了网址

    url(r'^messages/', include('postman.urls', namespace='postman')),
    

如何解决这个问题?

最佳答案

如果您在本地主机上,请尝试http://127.0.0.1:8000/postman/message/。它应该可以解决这个问题。 screenshot of the app url

关于python - Django Postman 实现发送消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51835312/

相关文章:

python - 在 Django 中通过 URL 传递静态字符串参数(模型选择)?

Python 键错误 : 'OUTPUT_PATH'

python - 如何在电子邮件中设置 Markdown 的默认样式

django - 在Django/Apache中的性能不佳

django - 如何将 Django 文件字段中的文件添加到 url 和 View ?

python - 如何在 Django 命名空间可重用应用程序中进行反向 URL 搜索

python - 针对单个键添加多个字典值

python - 变量交换是否保证在python中是原子的?

python - 用于匹配 IPv4 地址的正则表达式

python - 如何在 Django 上将 True 设置为 BooleanField 的默认值?