r/learningpython • u/ALX1S • Nov 07 '20
Question related with python - flask
Hello
I would like to ask you about a limitation that I am having, related with something that I am not finding (or not undestanding) a good solution.
A have a sort of complex script (at least to me) with a process that relates information entered by uster in 2 instances, and api gets into 2 services and ssh session to 2 servers in order to automate user addition in a project. My script is now working good but need to be executed from cmd (running on windows server now) and I would like to host it into a web page.
I was checking information about flask and see that some guys says that a separate web server is needed and some other do not. In this case the script will not have a high demand (just 1 user at the time and probably run 10 times as much in a day).
Do you happen to know If there are some good template where can I start from? I know that this should be very simple (the web service) but I am just able to print out the information but don't understand how to post reply from user into the flask service in other to inject information into the script. My plan b is a web cli, but is very nasty.....
Thanks you in advance
Alex
2
u/iamaperson3133 Nov 11 '20
There are questions to answer:
do you want to pass information in to the script from the web with an API or web form?
do you need a database to store and later fetch the results of the script running?
do you need to control who can use the resource with authentication?
imo, you probably want more features than you think. It takes a lot to give someone the ability to a execute some code securely over the internet.
Also imo, this may be a good opportunity for you to start learning a web framework like Django. It will help you implement the functionality that you don't realize you want yet. That might be bad advice, but I cannot know without knowing the finer details of what you're trying to do.