J want to do an app in python with django but it will be real time , and I would like to use Node.js for that. I've been looking for and I discovered that I can use Socket.io and "Include" it on the template and then socket.io will execute node.js
Do you have any tutorial or idea of this ?
You may want to have a look at this article.
It deals with push notifications from the server to the client with Django and node.js on the server side. And socket.io to interface with the browser.
Related
I'm having some troubles finding a good way to stablish a communication between my frontend and my backend.
I have a C++ app that deals with the communication with some device, I'd like that my webpage gets the request from the user, then send that request to my always running C++ app, process that request, and then send a response back to my webpage, is there any way to make this happen?
You could use Boost Asio to build a REST server into your C++ app see:
https://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/examples/cpp11_examples.html
Or you could use a C++ REST framework see:
https://github.com/Microsoft/cpprestsdk
There are a few others as well.
Finally you could build your REST/Web server using some other language such as Java or C# and use a messaging protocol to communicate to your C++ server. You could use sockets or ZeroMQ for example:
http://zeromq.org
I want to have Python script instead of browser as client and the client should be able to communicate with the server by websockets.
Basically I need the server to notify a python script in some other computer that some new information has arrived. I don't want my client to poll all the time.
Is this possible? Can anybody suggest some reading for doing this?
Sure, possible. One option for Python is Autobahn (https://github.com/tavendo/AutobahnPython), which supports Python 2/3 and Twisted as well as asyncio. It allows you to write WebSocket clients.
I am looking for a chat solution that I can integrate into my mobile app. So far, I have been looking into python solutions and have come across the "chat demo in tornado" library. Are there any more advanced solutions that I can look into ?
CHat demo link : https://github.com/facebook/tornado/tree/master/demos/chat
There is this play2 (java) app that has been developed as an example by Heroku that makes use of Redis and WebSockets: https://github.com/heroku-examples/play-websockets-chat-sample
It could be helpful.
There are lots.
Some django based are:
Using the excelent pusher.com service: https://github.com/andres-torres-marroquin/django-pusher-chat
https://github.com/qubird/django-chatrooms
uing comet: https://bitbucket.org/nicoechaniz/django-live/src
with tornado and websockets: https://github.com/aruseni/chat
https://github.com/sveetch/djangotribune
http://code.google.com/p/django-chat/
http://code.google.com/p/django-jqchat/
Some Flask based:
using gevent and websockets: https://github.com/kcarnold/flask-gevent-socketio-chat
using gevent and websockets running on heroku: http://callmephilip.github.io/chatzilla/
using websockets on heroku: https://github.com/heroku-examples/python-websockets-chat
I'm pretty sure that there are chat apps for most of the python web frameworks we know. I've listed only those for django and flask because they are my favourite web frameworks.
I know a chat software named 123 Flash Chat. I guess it will totally satisfied with your request. They provide mobile chat app integration for ios and andriod. You can have a try, hope it will help you. :)
http://www.123flashchat.com/mobile-chat-promo.html
http://www.123flashchat.com/build-mobile-chat-app
If you are looking for an android (JAVA) chat library I recommend MQTT chat. It is more than a library, a complete messenger with extremely fast messages dending using the MQTT protocol and also it provides audio and video calls with webrtc. integration is also very easy. Even a beginner in Android can integrate it
I'm looking for a library that work exactly like socket.io(node.js) but I need it in other platform, c++ or maybe python.
This is about server application for website. My app work with node.js but I need to change it for C++/python or something other.
socket.io is great because it choose technology automatically to connect with server - depend which browser/hardware you use.
Any ideas?
For Python, you could look into >> Websockets with python <<
Can I use Socket.IO with Django?
Django is a web-framework that uses Python language.
There is a Socket.IO implementation for python via TornadIO2, which is to be used with the Tornado async web server. I have used this when it was TornadIO 1.0
Go has one that I use, but its only compatible to Socket.IO 0.6.x: go-socket.io
And just look at the socket.io Wiki for other links:
https://github.com/learnboost/socket.io/wiki
The protocol definition for socket.io is available here
https://github.com/LearnBoost/socket.io-spec
I have been part of a couple of project where we decided to actually implement our own client for various reasons. It is not that hard especially since you only have to support on transport (xhr-polling is the easiest imho).
And also maybe a possibility to give back to the community....
For a brief overview/desciption, I am using Django as the bread and butter for a webapp. I want to add a bunch of "real-time" features to the app. More so then I can do with stuff like Torndao or django-socketio. So what I would like to do is take the full dive and use Django with node.js. Basically, Django will get all the data and and handle all the accounts. Then when a piece of data changes, it will send a message using AMQP which will route the message to node.js. Node.js will then use socket.io to get the fresh data to the browser.
My question is how to get the two to play together. Specifically, how can I get both on the same domain so that when the client connects to
var socket = io.connect('http://thedomain.com');
it will be dealt with by node.js and all the other requests will go to Django? Also, I would ideally like to have the Django app running on Heroku as a standalone app and have the node.js also running on Heorku on the standalone app, if possible. Any tips or pointers would be greatly appreciated! Thanks!