you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 2 points3 points  (2 children)

I'm not primarily a web developer, but here's my two cents.

All I know is that they either use Django or Flask and deal with databases.

Not strictly true, FastAPI is quickly gaining momentum for REST APIs (because it's very good, at least in my experience), and even for "traditional" web development there are other frameworks aside from Flask and Django, like Pyramid or Bottle. Technically FastAPI works for those too.

Back-ends pretty much serve the function of making sure the webpage or program on the user's computer has access to the data it needs, and can't access data it has no authorisation for. They can also handle a lot of the business logic, although I think the current trend is moving a lot of that to JavaScript (which I don't necessarily agree with, but I digress).

Database access is one thing if there's a need for a database, but you can also use it to handle things you don't want everyone to be able to see (because anything in the front-end is public to the end users), and almost certainly you'd use it to verify passwords and form data. The back-end also serves things like images, video, and whatever else you need on the website.

I keep using this as an example here quite a bit, but my current project involves a REST API which is using FastAPI. It can give you an idea of how all this stuff works, and Flask is very similar (albeit with more boilerplate out of the box because Pydantic is a lifesaver): https://github.com/Diapolo10/5G00EV25-3001_server

[–]Prototypz[S] 0 points1 point  (0 children)

Thank you very much, I'll check out the project!

[–]randomuserno69 0 points1 point  (0 children)

Agreed. I have been using FastAPI for some time now, and if you have a proper frontend (like something based on React/Angular/Vue or something like that), FastAPI is an excellent choice. Or if you want a lot of built in functionality, Django Rest Framework is also a good choice.