Re: Django channels with python background tasks

2018-05-27 Thread Roger Gammans
Jaiswal, Either my solution 1 or 2 will solve your problem, or rewriting your scripts as management commands (which is probably the easiest route). If you want to keep them separate :- For solution 1; I would look at using the requests library (see https:/ /pypi.org/project/requests/ ) in your back

Re: Django channels with python background tasks

2018-05-27 Thread Umar Kambala
Please when I runserver I gets this error, NameError:name 'template' is not defined. My templates are in this dir mysite/personal/templates/personal. What's my problem? On May 27, 2018 9:04 AM, "Roger Gammans" wrote: > I think there is a little bit of confusion in this thread,a s we keep talk > a

Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
Hi Roger, Thanks for your reply. Yes you are correct. There are actually 2 modules of this project:- 1. Django front end which is totally isolated in itself if I talk about it with back-end reference. And currently it has no mechanism whatsoever to communicate with back-end. 2. python based bac

Re: Django channels with python background tasks

2018-05-27 Thread Roger Gammans
I think there is a little bit of confusion in this thread,a s we keep talk about django and the deamon process and ignoring the frontend. So to clarify; there we are talking about a system with at least 3 execution environments: 1 The Browser2 Django backend processes3 The backend daemon/cli -proce

Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
HI Ryan, The back-end script in this case is not only doing telnet. Its getting data from multiple network elements using telnet and multi-threading. There are multiple threads started when I start the backend script which takes monitoring data from diff-diff network elements at the same time.

Re: Django channels with python background tasks

2018-05-27 Thread Sourabh Jaiswal
Hi Andrew, Thanks a lot for your reply. For a fast and easy approach I need the backend to be able to tell its status when asked by Django and be able to act when django sends some activity events. The back end will be a long running program which will run in an infinite loop once started by d

Re: Django channels with python background tasks

2018-05-26 Thread Ryan Nowakowski
Another idea: create a Django management command that does the telnet stuff and just run that periodically via Cron. You can always move to channels or celery later. On May 26, 2018 9:33:16 AM CDT, Ryan Nowakowski wrote: >In addition to websockets, channels can be used to run background tasks >

Re: Django channels with python background tasks

2018-05-26 Thread Ryan Nowakowski
In addition to websockets, channels can be used to run background tasks that could take a long time for example a telnet connection. You can Google Django channels background tasks. An alternative to channels for background tasks is celery. On May 26, 2018 5:03:51 AM CDT, Andrew Godwin wrote:

Re: Django channels with python background tasks

2018-05-26 Thread Andrew Godwin
Hi Jaiswal, I'm afraid that I can't give detailed help about what your best options are or walk you through how to do it - that's something you'll have to research and decide on yourself. Channels allows you to do low-latency communictation between Django back-ends and JavaScript, but anything you

Django channels with python background tasks

2018-05-25 Thread Sourabh Jaiswal
Hi, I am writing a python based application(CLI Back End) which does telnet to some network components and gets some data. It saves the data in sqlite db. For this application I am writing Django based frond end. Which will start the CLI app and monitor it. For communication between the CLI