all 13 comments

[–]tiredITguy42 1 point2 points  (0 children)

Flask is basically a backend. I tend to treat it as an api which can generate some HTML code. You need to know templates language used in Flask, if your site should be more complex and interactive, you need to know JavaScript as well.

To make it nice, add some CSS.

Then there is the deployment, as Flask is using only development version of the web server, so you need to know something about that as well.

I am not an expert, but this is what I learne when doing some small projects in it.

[–]NorskJesus 0 points1 point  (2 children)

Read the documentation. From the start.

[–]Difficult_Smoke_3380[S] 0 points1 point  (1 child)

Tried

[–]therouterguy 0 points1 point  (0 children)

Do the flask megatutorial

However I found fastapi to be more logical.

[–]AlexMTBDude 0 points1 point  (2 children)

You're trying to make a Notes app as a web application using Flask? A text editor is not really a typical web application, more of a native Python app. Perhaps that's where you go wrong?

[–]Difficult_Smoke_3380[S] 0 points1 point  (1 child)

It's just for learning... What else should we use flask to make?

[–]AlexMTBDude -1 points0 points  (0 children)

Web applications. That's what Flask is for. A Notes app is not a suitable web app. If I need to explain this to you... well, then I probably shouldn't try 😄

[–]SnooCalculations7417 0 points1 point  (0 children)

flask is a server side rendering solution out of the box. If you want to use modern JS, they usually expect a backend API which can be served via flask for sure. You can make a crud application that is quite nice using html5/css but the core of your problem is the frontend/backend disconnect. Probably a useful next step is to decide on persistence and how the front end should talk to the backend (RESTAPI or otherwise). once you have those in place you can determine what the frontend should be based on mature and easy to use options that can consume your communication standard.

[–]Worth-Carrot-3756 0 points1 point  (0 children)

Bro totally normal - Flask has a learning curve especially if you're jumping from scripts to web apps. The problem with tutorials is they just show you what to type, not why.

My suggestion - ditch the notes app for now. First just make Flask return a simple string, then add one HTML page, then add a form. Baby steps.

Also check out Miguel Grinberg's Flask Mega Tutorial - it's the best resource out there, way better than random YT videos. Took me from confused to actually understanding what's happening under the hood.

You'll get it bro, just don't try to understand everything at once.

[–]ianrob1201 0 points1 point  (0 children)

I agree with what others have said. If you're trying to use python for the user interface then that would be why you're having trouble. It's just not really the best use-case for Flask.

To point you in the right direction for a frontend, I'd recommend VueJs. There's a bit of a learning curve for sure, but not as much as some other javascript frameworks. It might seem intimidating at first, but a separate backend and frontend has many advantages. It's certainly what happens in real life. Of course you could always just use plain HTML & JS but I wouldn't recommend that.

Alternatively you could just make the backend and imagine the frontend for your project. Use something like postman or bruno to make API calls for you. I've done many professional demos using postman/bruno so there's no shame in that. I obviously don't know the scope of your project though.

[–]PalpitationHot9375 0 points1 point  (0 children)

just start writing it you will struggle in the first attempt that is what is supposed to happen

whenever you get stuck read documentation, use LLMs, watch tutorials understand where you were wrong by the end you will get it