Question regarding Interactive Python shell response and django

34 views
Skip to first unread message

Michael Karikari

unread,
Apr 26, 2020, 10:05:02 AM4/26/20
to Django users
So I find myself in a pickle. 
I'm using an external python API with Django, and as part of that interaction, it asks for an input from the Django python shell window. What I am trying to figure out is how can I get form input from web application to push back to the shell window. Appreciate it if anyone has experience on how to do this or work around this. 

Attached is a screenshot of what I'm looking at. Im hoping there is a clean way of pass form data to this type of interaction

django.PNG

Ryan Nowakowski

unread,
Apr 26, 2020, 12:09:13 PM4/26/20
to Django users
You might be able to do this with a web-based Python shell like Jupyter.

However I'd like to suggest an alternative approach. Rather than figure
out a way for the user to have this same kind of shell interaction on the
web, what about integrating Django with the underlying protocol, SAML?

Derek

unread,
Apr 27, 2020, 10:51:10 AM4/27/20
to Django users
I think you are better off creating a proper API for your Django project, using something like DRF.

The Django shell is meant for direct use by an administrator working on the server.

Michael Karikari

unread,
Apr 28, 2020, 5:30:22 PM4/28/20
to Django users
Ill have to look at the DRF option, the python API I'm connecting assumes you are doing this from shell, so I was trying to work around that fact

Michael Karikari

unread,
Apr 29, 2020, 6:27:22 AM4/29/20
to Django users
I'm not sure if DRF will work for me. I guess I should rephrase my question:

If I'm using an imported module from a Django view that requires responding to executing from the console, is there a where to surface that request through the web app to end-user can do the input?

Derek

unread,
Apr 30, 2020, 5:28:42 AM4/30/20
to Django users
Again; the issue is why are you mixing up the console/shell with the web-facing aspect?  These are designed for different ways of interacting with Django.  Its almost like you are asking "how to hit in a screw with a a hammer?". What is the underlying problem you are trying to solve?
Reply all
Reply to author
Forward
0 new messages