a reusable private user messages application for Django with Django Rest Framework
Project description
Django Messages DRF
Table of Contents
About Django Messages DRF
Django Messages DRF is an alternative of django_messages_drf but using Django Rest Framework making it easier to integrate with your existing project.
Django Messages DRF is based on django_messages_drf way of implementing but applying DRF.
A special thanks to pinax for inspiring me to do this and use some ideas.
Overview
django-messages-drf
is an app for providing private user-to-user threaded
messaging.
Supported Django and Python Versions
Django / Python | 3.6 | 3.7 | 3.8 | 3.9 |
---|---|---|---|---|
2.2 | Yes | Yes | Yes | Yes |
3.0 | Yes | Yes | Yes | Yes |
3.1 | Yes | Yes | Yes | Yes |
Documentation
Installation
To install django-messages:
pip install django-messages-drf
Add django_messages_drf
to your INSTALLED_APPS
setting:
INSTALLED_APPS = [
# other apps
"django_messages_drf",
]
Run Django migrations to create django-messages-drf
database tables:
python manage.py migrate
Add django_messages_drf.urls
to your project urlpatterns:
urlpatterns = [
# other urls
url(r"^messages-drf/", include("django_messages_drf.urls", namespace="django_messages_drf")),
]
Reference Guide
URL–View–Template Matrix
URL Name | View |
---|---|
django_messages_drf:inbox |
InboxListApiView() |
django_messages_drf:thread |
ThreadListApiView() |
django_messages_drf:thread-create |
ThreadCRUDApiView() |
django_messages_drf:thread-send |
ThreadCRUDApiView() |
django_messages_drf:thread-delete |
ThreadCRUDApiView() |
URL Names
These URL names are available when using django_messages_drf urls.py:
django_messages_drf:inbox
— Inbox view.django_messages_drf:thread
— Lists the details of a tread of a User. Requires a UUID of a thread.django_messages_drf:thread-create
— Create new message to specific user. Requires a User PK (user to send).django_messages_drf:thread-send
— Replies to a thread. requires thread UUID.django_messages_drf:thread-delete
— Delete message thread, requires thread UUID.
Views
InboxListApiView
- Display all message threadsThreadCRUDApiView
- Create a new message thread/Reply to ThreadThreadListApiView
- View specific message threadThreadCRUDApiView
- Delete specific message thread
Signals
message_sent
— providing_args = ["message", "thread", "reply"]
ChangeLog
1.0.2
- Added support for python 3.9
1.0.1
- Fixed tests naming conflicts.
- Fixed migration issues.
- Updated README.md to make it clearer.
- Added CircleCI config
1.0.0
- Initial release
License
Copyright (c) 2020-present Tiago Silva and contributors under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for django_messages_drf-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 915f54e8d63c998c5451d6855fc4171845a9d94d09e53f51bc150f5f828786c5 |
|
MD5 | 297d7a5c7ff10a5d70acdfc48b9159d6 |
|
BLAKE2b-256 | 93bab18bd520ebbde126f24748ae2eccb38308ac4b01262b7af593e5f31a6082 |