Django Postman implementation for sending messages

徘徊边缘 提交于 2019-12-23 01:34:48

问题


I am trying to use the Django-Postman framework to send messages between users in Django 2.0. I have installed the app and made the necessary changes as mentioned in the docs of the framework.

However when i try to go the the message urls I get a blank page (like this screenshot):

Here is what I have done so far:

  1. Installed django-postman
  2. In 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 = 'from@host.tld'  # 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. And I have linked urls this way in urls.py

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

How can I solve this problem?


回答1:


There appears to be a email backend missing. For example, I added:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
POSTMAN_AUTO_MODERATE_AS = True  # default is None


来源:https://stackoverflow.com/questions/51835312/django-postman-implementation-for-sending-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!