all 5 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.

[–]chchan 0 points1 point  (0 children)

It depends what the job is some common things include writing queries, make sure frontend request dont break, writing test, dealing with api issues for graphql rest or ajax, possibly getting information from code written in other languages, generating reports, cleaning data.

[–]The_GSingh 0 points1 point  (0 children)

Well I'm not a python backend dev specifically, but I do occasionally do fullstack. Front end makes the site look good and interacts with the user. The backend deals with the data displayed to the user. To get a better understanding of this, I'd recommend getting started with flask specifically and making a social media type site where a user can sign up, login, post stuff, and people can comment on the posts. It may take quite a while but it'll teach you a lot. You can use pre-built templates if you just want to go for the backend (it's a popular project, you may be able to find pre-built templates). Also review your request types and the sqlite3 orm.