django-df-chat
Development
Installing dev requirements:
pip install -e .[test]
Installing pre-commit hook:
pre-commit install
Running tests:
pytest
New Design
Model Data
ChatRoom
- title = CharField()
- users = ManyToManyField(through="ChatMember")
- chat_type = Enum: 'private', 'group',
ChatMember
- is_owner = BooleanField(default=False)
- is_admin = BooleanField(default=False)
- user = ForeignKey(ChatUser)
- chat_room = ForeignKey(ChatRoom)
MemberChannel (service table)
- last_alive_at = DateTimeField()
- channel_name = CharField()
- user = ForeignKey(ChatUser)
ChatMessage
- created_by = ForeignKey(ChatUser)
- chat_room = ForeignKey(ChatRoom)
- message = TextField(settings.CHAT_USER_MODEL)
API:
[GET] /api/v1/chat/rooms/
[POST] /api/v1/chat/rooms/
[GET] /api/v1/chat/rooms/{id}/
[PUT] /api/v1/chat/rooms/{id}/
[PATCH] /api/v1/chat/rooms/{id}/
[DELETE] /api/v1/chat/rooms/{id}/
[POST] /api/v1/chat/rooms/{id}/member/
[GET] /api/v1/chat/rooms/{room_id}/messages/
[POST] /api/v1/chat/rooms/{room_id}/messages/
[GET] /api/v1/chat/rooms/{room_id}/messages/{id}/
[PUT] /api/v1/chat/rooms/{room_id}/messages/{id}/
[PATCH] /api/v1/chat/rooms/{room_id}/messages/{id}/
[DELETE] /api/v1/chat/rooms/{room_id}/messages/{id}/
Use cases:
- Create chat room with specific type, and add user. Channel layer should be created if user are online and all online users should to receive messages
- Private chat room (chat between 2 members). Nobody can add new members.
- Group chat (chat between multiple users). Users could be added through API endpoint call
- moderation part is missed at the moment
Flow:
- User connected to WS
- Channel layer stored to DB to use it in a future to dynamically subscribe user with a new chatRooms
- on user disconnected channel layer should be removed from DB
Metadata
Release files for django-df-chat 0.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-df-chat-0.1.7.tar.gz | 11.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_df_chat-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.1 kB
Release files / django-df-chat-0.1.7.tar.gz
| Download URL | django-df-chat-0.1.7.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4edefa25748e8fc75a73b230900355baa0221f896bc0e2c054d8fb6eb494e1b
|
|
BLAKE2b-256 checksum How to use checksums |
dfd74ef7f7e5f3c5963ef8c9cfa0afcdc7769c3587e5e765a9e894fbd835a907
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / django_df_chat-0.1.7-py3-none-any.whl
| Download URL | django_df_chat-0.1.7-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54c3f72e25f9f4a9199d90ec1fe8f09e6e88cd073eb2d809fd64c132f27b589e
|
|
BLAKE2b-256 checksum How to use checksums |
4827f2b37ee5c8cc037a77da0a925953f4d2a3c089174dc46ad46e44bed6275a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for django-df-chat 0.1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.