I want to make my own on Django-app. The app must have an messages-application not only for notification but for chatting between users. So, for example I've write a model for messages, so where I have to save the messages? In the database, or maybe it is not a good style of coding and bad for work speed?
1 Answers
It depends. You could save your messages in the database if you need the classical approach to messages. This would best work for messages sent in e-mail or bulletin board "style".
If however you need real-time behavior and lots of messages, having a database inbetween might slow things down a bit. You could use node.js for a real-time chat.
If you are intending to use Django-Messages as a means to communicate between users, it wasn't meant for this. It is simply used for displaying flash notifications for users when they navigate through pages in your app. They are normally stored in the session and used only for the following page, afterwards being deleted.
I cannot give more details because your question is quite vague. Firstly you need to find which are your plans, how do you intend to use the "chatting between users".

- 17,038
- 20
- 114
- 194
-
Thank you. Now I do not need a real time chat. I need a classic style, as you said. So, based on your words saving messages in a databases seems fine. Also, I found information that it is possible to use Twisted or Tornado to make a real-time chat with Django. – kozlone May 17 '15 at 17:27
-
For the classic approach, databases are the way to go. That's what they're made for. As a reference, all bulletin boards and probably most of messaging systems within apps use a database backend. – linkyndy May 17 '15 at 17:30