-
Notifications
You must be signed in to change notification settings - Fork 0
Using django messages
Gjergj Kadriu edited this page Jul 29, 2018
·
3 revisions
- Include django_messages to the INSTALLED_APPS setting
- Include django_messages.urls to your main urls.py
- Create a folder
messageinside your apps templates folder - Create
create_message.htmlinside message folder - Create a form with
form.as_pand submit button that posts to the same page - Create
message_confirm_delete.htmlinside message folder - Create a form (method POST) with a submit button that posts to the same path
request.user|getInbox on your html pages to get all conversations the current user is participating along with last_message ( dict of {conversation:last_message} )
{% for conv,message in request.user|getInbox %}
- {{conv}} - {{message}}
{% endfor %}