Django building a user-to-user messaging system [closed] - django

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I'm trying to build a messaging system for my website using Django but I don't know how to do. What I want is a system that enables a user to send a message to another user, with an inbox to see the received messages and notifications that warn the user he received messages. Since it's a feature many websites need, I guess there already exists some build-in functions and templates to do that in Django. I made some researchs and I found existing apps like django-messages or django-postman but there are little or no documentations about these apps, the ways to use it in the view, the way to customize the message model or the templates, ... . I guess these apps are not widely used since there are no tutorials about them or precise documentation, but I didn't found other apps for messaging.
To summarize my question, what is the easiest way to build a customizable messaging system in Django ? If it's an app, where can I find good and easy documentation/tutorial about it ?
Thanks in advance !

If you want a quick & simple solution I can suggest:
Create a Conversation model which will hold participants and messages using m2m fields.
Create a Message model which will hold sender, recipient and message content and other metadata (send date, read date etc.)
Then you should create a save method for message which will create a Conversation object according to sender and participant.
The rest is creation of some querysets which will filter out messages and conversations.

Related

Which one is better to user between Parse, Firebase and AWS Cognito? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am willing to use synchronisation service for my application. But I want to choose the best one. I want to know which one is better among all these. My application will run on Android , IOS , Windows and Web.
I am going with Firebase because I tested it. It is giving me fast results and it is also allowing me to work offline. Is it better or I will go with Parse or AWS Cognito?
I Also have an option of Google Cloud. Does Google Cloud provides service like Firebase? And are realtime updates possible with Parse as like Firebase?
Codeek has a good point that this question is opinion based, so take my answer with a grain of salt.
I have experience with both Parse and Firebase, but not with Cognito.
In my experience, Parse is better when working with large relationship-based databases. (I.E. databases where multiple classes of objects are pointing to each other and interact.) In this system, it is easy to store a lot of data very succinctly, but working with this data is done via snapshots. This means that you can take a snapshot of the data, edit it, and then refresh the server with the updated snapshot. This is perfect for things like my delivery application where only one user is updating the orders on our server at any one time.
Firebase implements a model-observer scheme, and so it is much better for applications that are highly interactive. For instance, I have used Firebase for creating a real-time game of hot potato. The advantage here is that changes to the data on the server are automatically pushed out to all devices that have registered as listeners (functionality not available on Parse from my experience). This keeps all users on the same page all the time. The downside is that the database is structured in a hierarchal manner and doesn't have defined "objects". Rather, it is structured via key/value pairs where parent keys cannot have an associated value. To illustrate this, a sample structure for storing a game on my database went something like this:
-Games
--1
---Users
----1 = "example#gmail.com"
----2 = "example2#gmail.com"
---PotatoHolder = 1
---TimeRemaining = 30
---Loser = -1
Cognito I am not familiar with, so I'll allow someone else to explain how that database system is designed.
In summary, codeek is correct that this is an opinion-based question, but for two of your options a good rule of thumb from my experience is that Parse is fantastic for large relationship databases in conjunction with single-user applications (i.e. single-player or turn based games). Firebase is more suited to hierarchal data systems in conjunction with real-time multiplayer applications.
I hope this helps! If you could post a little more about what kind of application you are trying to build then perhaps I, or someone else, could provide a little more guidance.
Expanded Answer: Although this question has been marked as off topic, to answer Nidhi's follow-up question if there is a way to use Parse as a model-observer scheme: Not easily. Using a timer is the simplest option. The other option is to use push notifications. This would require getting permission from you user. You can set the Cloud Code on Parse to automatically send push notifications all relevant users and then intercept them within your client so that they are "silent". In other words, when they arrive, you can have your client respond by updating your game without showing a ribbon or notification like normal push notifications. I have not done this myself, as I prefer using Firebase for that kind of application, but I believe that it is possible.
Source: PFQueryTableView Auto Refresh When New Data Updated or Refresh Every Minute Using Parse
Keith's answer is similar to Nidhi's reference to refreshing PFObjects via a Timer, Handsomeguy's comment refers to the possibility of "silent" push notifications.

Private Microblogging/Twitter-like Service [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Are there any cloud based private Twitter-like services out there?
I am working for a client who needs a service like this implemented, but we don't have the time or budget to create one from scratch.
I am looking for something with a REST api where I can create an account on it from the master server, set an account to follow another account, post updates for accounts, and then get a feed of posts (sorted by date) from accounts that another account is following (like a facebook wall, or twitter feed). It would be great if it could automatically scale out to hundreds of thousands of users, with perhaps 50 000 daily posts being made.
I had thought about implementing this myself, but it seems like there are some tricky areas when it comes to having an account following a few thousand other accounts, or being followed by 10s of thousands of accounts, and generating the feed in somewhat realtime as posts come in.
I have found some services such as http://www.ning.com/ and http://www.socialengine.com/ but I'm not sure if they can do what I need, and they seem to be very focussed on having a website. This is for a mobile app so that is not required.
There are a few open source projects out there, but they would all require setting up/maintaining hosting (not a huge problem) and I'm not certain how scalable they are (the client requires it scale up to at least 100k users).
I'm sorry for the late reply. I hope it will be useful to others looking at this.
I had pretty much the exact same need as you, and ended up creating a full-featured solution after finding no other resources. The service is called Collabinate (http://www.collabinate.com). It provides a RESTful API that focuses on simplicity and ease of use, and currently leaves the UI completely up to you. It uses a graph database and algorithms in the backend, and scales quite well for your situation.
Maybe private team inbox can fit in your solution too...
https://www.flowdock.com/
there is not a following feature in this but if this is an internal company need...
you can create chat rooms for departments and in general ... maybe the chat rooms can be the following feature for you
Looks like there isn't a good solution here.
I have found jaiku which looks incredibly complex and doesn't seem to run on the latest app engine sdk.
There is also diaspora which could be modified and run on your own server to do what is needed.
In the end, I have decided to just implement this myself on Google App Engine. It seems the best way to do what is needed. Using the fan-out pattern seems to be the best way. The Fantasm library seems to provide an easy to use way to do this, so I am going to try that.

Is there a good database backend in Django for Amazon DynamoDB? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I would like to use DynamoDB for my next Django project. I have found implentation to store session data into DynamoDB, but is there backend implementation for Django to store all the database data?
I don't think there are any Django DynamoDB projects out there that allow you to use the Django ORM while using DynamoDB underneath.
But depending on your case, you may still be able to simply ignore the ORM portion of Django and use DynamoDB directly (via boto or PynamoDB or similar ).
In my case, I use a mix. I keep all my users and other models that are mostly read only on Postgres (RDS) and Django ORM, but use DynamoDB for models that require heavy writes ( using pynamodb).
I still get to use the views, templates or even add an API via Django-rest-framework. What I lose is the admin pages ( that I don't need for these models ) and other features the ORM gives you but I have been happy with the result anyway.
I have not used this one personally but the guy who developed it is a frequent contributor to boto and his work has always been of high quality.
https://bitbucket.org/maxnoel/dynamodb-mapper
Here is a project on github called django dyanmodb sessions which looks incomplete (no closing of sessions), but promising. Here is a link to an announcement from one of the authors.

Collecting data from website without API [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am looking to build a webapp to improve user experience in booking railway tickets in India. The API is impossible to get due to hefty charge to procure it. I have seen many apps that provide details of the trains etc through their apps.
My Question is how are they scraping data from the website.In general how can I legally get data shown to user (I don't want payment and stuff that are impossible without API) on any website. How do people scrape such data? Any tools/methods?
Bear with me if question is naive. I'm pretty new to this stuff.
They can get the train schedule information using any one of several programming languages though it is most likely done with ordinary PHP and any good webserver host. For example all indian train schedules can be found on the indianrail.gov website.
Sending a specially built URL to ..
http://www.indianrail.gov.in/cgi_bin/inet_trnnum_cgi.cgi?lccp_trnname=1123
using the POST method of sending form data should give you all the details for train number 1123 After that it becomes just a simple task of tidying up the results for storage in a database.
Update: well armoured site its checking both the user agent and referer of inbound requests.
Ammendum: the indianrail.gov site is changing to http://www.trainenquiry.com/ -> will have to take another look

Does ESPN Cricinfo have an API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Has espncricinfo.com exposed an API? I'm interested in live scores, news, and maybe photos.
Up until now I have only known of the rss feed..
I do not believe an API exists - unfortunately.
What a number of users have done - and what is suggested by cricinfo themselves - is use Yahoo Pipes to merge a number of different feeds. You can then get the resultant pipe in JSON and other formats.
It's probably best demonstrated by example by looking at a 'Latest cricket scores' pipe here: http://pipes.yahoo.com/pipes/pipe.info?_id=tMcVGcqn3BGvsT__2R2EvQ
Of course, it would be nice to be able to search the statistics and a REST service which returns the bare data for a statsguru search, but the only suggestion I have at present is to build statsguru queries manually with wrappertype=print appended and then use xpath to filter out the data you require.
An example statsguru query:
http://stats.espncricinfo.com/ci/engine/player/13418.html?class=1;template=results;type=allround;wrappertype=print
You can use Yahoo! Query Language (YQL) for fetching latest cricket data. It returns the result both in JSON and XML format. You can find it here : http://developer.yahoo.com/yql/console/?env=store://0TxIGQMQbObzvU4Apia0V0&_uiFocus=cricket
ESPN Developer Center Launches, Opens Sports APIs to App Builders:
The Headlines API is free for non-commercial use in apps performing up to 2,500 API calls per day. As outside apps that use ESPN APIs increase in user base, developers enter individual partnership agreements with the company. If you want to use ESPN's new APIs, visit the Developer Center ( http://developer.espn.com/ ) and request a developer key.