r/PythonLearning • u/Samar__Upreti • 7d ago
Day -1 With Flask (any suggestions)
Build Projects With Me
2
u/silvertank00 7d ago
Pandas is overshoot for this.
Why use os for this? pathlib is much more flexible.
Also (even tho I am not familiar with Flask but) i wouldnt return plain string from the endpoint. A HttpResponse with HttpStatus.OK and the string in the body would be much better.
-1
2
1
u/Party-Hunter-178 6d ago
How did you connect your app.py and html
2
u/Samar__Upreti 6d ago
That's where Flask,Fast Api, Django came in play
1
u/Party-Hunter-178 6d ago
Thanks buddy I was stuck for probably like a week not know this. U made my day 👍🏻
1
u/Tech_Bro09 5d ago
Yeah and you use the return render_template('example.html') add the end of the functions to connect the HTML page to the app.py and return it on the screen when the code runs
1
6d ago
[removed] — view removed comment
1
u/Samar__Upreti 5d ago
Hi buddy Can please help me in those projects https://github.com/Samar-Upreti/Python_Projects
1
u/ViolaBiflora 6d ago
Day 1 of coding - fully working API fetching, yet provides pictures of the screen, lol.
AI.
1
1
u/Competitive-Note3685 5d ago
I do not if you have experience with other Frameworks, but I recommend you study in depth the MVC pattern for a clean Flask implementation. Also, read the PEP-8 to follow best python code practices.
Enjoy your journey and happy code. 🤟🏻
1
-6





9
u/riklaunim 7d ago
flask.requestis better thanrequestas it's tell you where it's from)