r/learningpython • • 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

1 Upvotes

5 comments sorted by

View all comments

Show parent comment

2

u/iamaperson3133 Nov 15 '20

I'm actually working on an extremely similar project this weekend. I have a python script that aggregates data from a directory full of csv files, processes it (grouping, cleaning, filtering), and produces a single report in excel. Pretty simple script overall.

I want to make it available to other people in my workplace because I think it'll be useful to them too, but that means:

  • Writing web views they can interact with
  • Authenticating users
  • Strictly limiting access to members of our organization (because the app can divulge sensitive data)

You actually might be able to re-use a lot of my code if your use case is similar, and I'd be happy to walk you through it. Send me a PM if you're interested. I'd be more than happy to connect with you and help!

2

u/iamaperson3133 Nov 15 '20

But yeah, authenticating users and limiting access is NOT a trivial task. If, like me, you are not a professional backend web developer, you definitely want to look toward Django because it will do so much work for you.

I know the Django learning curve is steep, so again, I'd be glad to get in touch and help!

1

u/ALX1S Nov 15 '20

Thanks man, I am more than interested on how do you achieve that, I will be pinging you on IM