1

I have a Python script which communicates with a Financial site through an API. I also have a Django site, i would like to create a basic form on my site where i input something and, according to that input, my Python script should perform some operations.

How can i do this? I'm not asking for any code, i just would like to understand how to accomplish this. How can i "run" a python script on a Django project? Should i make my Django project communicate with the script through a post request? Or is there a simpler way?

3
  • 4
    If it's Python, why can't you simply import it into your view and call it from there? Commented Apr 3, 2019 at 17:53
  • @DanielRoseman It's an option, but my actual Python bot has to perform a lot of operations and it has to be as fast as possible, would calling it as a view be the best for this case? Commented Apr 3, 2019 at 18:02
  • I don't really understand the connection. How you call your script has nothing to do with how fast it is. Commented Apr 3, 2019 at 18:18

2 Answers 2

2

Since you don't want code, and you didn't get detailed on everything required required, here's my suggestion:

  1. Make sure your admin.py file has editable fields for the model you're using.
  2. Make an admin action,
  3. Take the selected row with the values you entered, and run that action with the data you entered.

I would be more descriptive, but I'd need more details to do so.

Sign up to request clarification or add additional context in comments.

Comments

0

I agree with @Daniel Roseman If you are looking for your program to be faster, maybe multi-threading would be useful.

1 Comment

If you want to run the bot in the background while you are performing other operations in the function at the same time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.