Hi Chris,
The problem you describe does not require Django at all to be solved.
WRT process parameter input, what you need here is a simple Web based UI with a basic form. Of course Django can do it, but if you don't need features such as the ORM, admin... you can implement it with a couple of lines using lighter frameworks (e.g. Tornado).
The point about monitoring the process requires first that this process is able to provide a feedback on demand. On *nix systems, this can be done by handling one of the USR signals (e.g. SIG_USR1) and of course implementing the process in non blocking mode (to be able to handle the USR signal while computing).
How the feedback is returned to the end user is another story. Real time feedback in Web apps is preferably done using Web sockets (rather than polling periodically the server from JS code on the UI page). Who will push the feedback on the socket ? It can be the computation process itself, supposing appropriate connection information are passed to it. But it is cleaner to separate concerns and isolate this in a monitoring specialized layer, communicating with the computation process via Unix sockets for instance or capturing its stdout and grabbing dedicated messages in it (e.g. a message like "PROGRESS: 30"). One option for implementing this monitor is using job Queues, as provided in the multiprocess part of Python standard lib. One you also use Celery, RQ or any job queue framework, but chances are that this would be overkill (especially Celery). RQ is maybe a good choice here, since very lightweight and having RabbitMQ as its only dependency.
Hope this helps
Regards
Eric
Sent: Wednesday, January 2, 2019 10:05:39 PM
To: Django users
Subject: Best way to submit application cmd, then download a resulting file?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6ba9ac84-366c-4c91-b068-3ecc65c27a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment