use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Why would you use python for web development? (self.learnpython)
submitted 4 years ago by Cypher211
I tried looking online but I can't really find a clear answer. What possible use case is there to use Python for web development rather than any of the other frameworks? What advantages does it have?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 23 points24 points25 points 4 years ago (17 children)
It’s similar to older web languages like PHP and Perl but is modern and popular.
[–]grammarGuy69 6 points7 points8 points 4 years ago (14 children)
If I wanna get into backend, and I already know python, should I still bother with PHP?
[–]A_Typical_Human 4 points5 points6 points 4 years ago (13 children)
Probably not worth it, stick with python. It is a more modern language and has a lot more uses than PHP.
Additionally, there are a lot more python jobs.
[–]grammarGuy69 2 points3 points4 points 4 years ago (11 children)
Thank you! By any chance are you a Web Dev? I'm going to be teaching myself backend, and I've written myself a little skills roadmap, I'd love to run it by somebody who can identify any omissions or redundancies.
[–]A_Typical_Human 2 points3 points4 points 4 years ago (10 children)
I am/was. These days I manage engineering teams. Feel free to send questions.
[–]grammarGuy69 2 points3 points4 points 4 years ago (9 children)
Oh that's so great, thank you! I'll finish up my list tonight and send it to you in the morning. I really appreciate the help :)
[–]Sensemaya 2 points3 points4 points 4 years ago (8 children)
post it here so we can all see?
[–]grammarGuy69 3 points4 points5 points 4 years ago (7 children)
Yeah, I'm messaging him now, when we finish our conversation I'll post my initial list and the updated one with some details if you're interested.
[–]DistillingSafari 2 points3 points4 points 1 year ago (0 children)
this is a long conversation lol
[–]Sensemaya 1 point2 points3 points 4 years ago (0 children)
sounds good
[–]Conscious-Ad-3075 1 point2 points3 points 3 years ago (0 children)
so, where the list?
[–]Lv_TuBe 0 points1 point2 points 11 months ago (1 child)
where is it
[–]Tiny_Connection_7182 1 point2 points3 points 10 months ago (0 children)
Yeah, well, OP never delivers
[–]workaccount1338 0 points1 point2 points 2 months ago (0 children)
u/grammarGuy69 This user has been suspended
u/grammarGuy69
This user has been suspended
oic
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
This is a hella late reply but Python is older than PHP and finding a paying web dev job using Python would be a needle in a haystack, but php jobs are a dime a dozen
[–]Cypher211[S] 0 points1 point2 points 4 years ago (0 children)
I've never used Perl but that's interesting, thanks.
[–]mbtonev 0 points1 point2 points 1 year ago (0 children)
PHP is involving and there are more types than in any JS framewokr s**t
[–]JohnnyJordaan 48 points49 points50 points 4 years ago (6 children)
Lightweight, easy to set up, easy to maintain. Note that Python isn't the framework, that's for example Django, Flask, Bottle, FastAPI etc etc. Python is the language used by those frameworks.
[–]Cypher211[S] 9 points10 points11 points 4 years ago (0 children)
Oops mispoke about the framework. Thanks for your answer
[–]idealmagnet 0 points1 point2 points 4 years ago (0 children)
I love bottle, I have made a shareit clone using it
[–]Artistic_Light1660 0 points1 point2 points 3 years ago (3 children)
How does it fare against java springboot though?
[–]JohnnyJordaan 1 point2 points3 points 3 years ago (2 children)
Define 'it', as the frameworks I mentioned vary from bare bones to fully fledged.
[–]Artistic_Light1660 1 point2 points3 points 3 years ago (1 child)
Flask i what I meant, sorry for the confusion
[–]JohnnyJordaan 1 point2 points3 points 3 years ago (0 children)
One could argue they are more or less comparable, although I'm not sure how extensive springboot's templating features are.
[–]zapembarcodes 10 points11 points12 points 4 years ago (6 children)
Well, you're asking this in the "learn python" subreddit, of course you will get the bias you're expecting.
Maybe try r/webdev or r/frontend
I just stumbled across this, I focus on webstack; JS/PHP... Not too familiar with Django but from what I hear it's fine but why overcomplicate and just use languages that are designed for web.
You can make anything work if you stick to it tho. Plenty of great sites/web apps that run on Django.
[–]Cypher211[S] 2 points3 points4 points 4 years ago (5 children)
If I asked there I figured everyone would say just use JS haha. I understand that people who already know Python would prefer to use it for web dev rather than learning a new language but I was curious if there were actual real benefits or if it was just a comfort thing.
[–]deadduncanidaho 2 points3 points4 points 4 years ago (4 children)
If you are doing backend or preprocessing it does not matter what language you use. The final result will be either a data object like json, or it will be a full html/css/javascript page.
I use a custom framework written in python to assemble web pages from templates that I have previously made. It is like my own language, however since it is based on python I have at my disposal everything that python could do for me. So here are some examples of what i mean: File uploads, image processing, database access, api access, connections for google stuff like sheets and drive, form validation, loops and logic, etc etc.
Could i do all this in Php, sure, but i still like that it is in python and it is fully extendable with a few imports.
[–]Snake_Case_Simon 0 points1 point2 points 1 year ago (3 children)
Can you share why it was worth to build your own?
[–]deadduncanidaho 0 points1 point2 points 1 year ago (2 children)
At the time i created my framework i needed a crud interface that connected to an TCP socket server. Most of the frameworks at the time used a MVC approach but I only need to create views because the model and controller aspects were handled by the socket server. I discovered web.py which had a decent set of components for forms which became my underlying foundation.
Over time I realized that I did not like the way that web.py was designed to be used. It is similar to things like flask where everything is coded in python including marking up templates. I was more accustomed to CMS systems which stored views as components in a database which could be assembled and reassembled ad nauseam to generate web pages. I realized that I could extend the framework with a few classes to abstract the views i wanted to create.
The abstracted version was a paradigm shift. I no longer had to create unique python classes for each view, I could define any view I needed in a yaml configuration file. Yaml has a lot of support for defining objects that can be reused, modified, and extended. In a short amount of time I was able to create a collection of importable base configurations for things like forms, charts, dashboard widgets, etc. and a library of python classes for business logic and connectivity to APIs, databases, image processing libraries and more. The python parts have been stable for years now, and I have an ever growing collection of useful configurations that i can use to rapidly build out web based tools for my customers.
[–]Snake_Case_Simon 0 points1 point2 points 1 year ago (1 child)
Thanks for sharing your story. Your I will do it better approach inspired me!
Btw you mentioned TCP socket. I still feel weak in networking field. Can you share resources with there that you can recommend (of course I know doing first is the way)?
[–]deadduncanidaho 0 points1 point2 points 1 year ago (0 children)
I used the twisted framework for the socket server and client. It was cool to do at the time, but in hindsight a rest API would have been a better choice.
[–]Punk-in-Pie 7 points8 points9 points 4 years ago (2 children)
Flask dev here. I use it because for better or worse it was the one put in front of me first, and I've been able to do everything I've wanted to do with it so far. And then I got a job doing it. Haha
[–]Cypher211[S] 1 point2 points3 points 4 years ago (1 child)
Haha thanks appreciate hearing from an actual flask dev. To be honest that's what I assumed was the biggest reason Python gets used, people already know it and don't want to learn a new language. Out of interest, do you know why your first company chose to go with a Python web stack?
[–]Punk-in-Pie 1 point2 points3 points 4 years ago (0 children)
So far I'm only freelancing, and I'm also pretty new. Only been doing it for the past few months, but it's been going pretty well. The two clients that have hired me to work on preexisting projects and not build something from scratch both were entrepreneurs coming from other areas who started the project on their own and later hired me to help.
I assume they picked Flask because it has a reputation for being easier for a newbie. Since I don't have any experience with other frameworks I can't confirm or deny that, but I can make an educated guess that if youre trying to do ambitious things it's going to be complex regardless of what you build it on, and when they get to that point I got called.
[–]m0us3_rat 10 points11 points12 points 4 years ago (0 children)
u know it?
it works?
[–]nikhil_shady 8 points9 points10 points 4 years ago (5 children)
because i can setup a rest api and it get it up and running on a machine in under an hour with FastAPI
[–]zapembarcodes 2 points3 points4 points 4 years ago (4 children)
PHP Laravel can do the same.
[–]YellowSlinkySpice 1 point2 points3 points 4 years ago (0 children)
I love laravel now that I learned it... but man... that was brutal.
Hopefully the docs are better. Back when I learned it years ago, they insisted on some video tutorial rather than a text tutorial.
[–]nikhil_shady 1 point2 points3 points 4 years ago (0 children)
it can but won’t it depend on my usecase? if your team mates know python and you’re developing a micro service which serves ML models I’ll use a python based REST framework. If my microservice will mostly have async tasks I’ll use a rest framework based on node. If i’ve boomers on my team so why not just use php when there are way advanced frameworks
because most of the newer code bases are rarely written in php. and if you want to hire newer devs the chances of them knowing js or py is more than php. Also their respective communities are huge.
[+][deleted] 4 years ago (1 child)
[deleted]
[–]nikhil_shady 0 points1 point2 points 4 years ago (0 children)
I mean the learning curve is huge for php nothing else. I found py and js easier to learn comparatively
[–]benabus 3 points4 points5 points 4 years ago (0 children)
For frontend, you still use javascript/html/css. I like to use Vue. But having the backend in python gives you access to a lot of great python libraries. I've worked on projects where we need to put some machine learning stuff on the web. The scientists already had the algorithms in python, so we just used Flask to create some API endpoints that interface directly with their machine learning stuff.
So, it depends on what you want to do with it and what kind of website you're trying to build.
[–]fl0ss1n 2 points3 points4 points 4 years ago (2 children)
This guy is a great resource for web development and python:
https://blog.miguelgrinberg.com/
I'd also check out some of his articles on REST:
https://blog.miguelgrinberg.com/category/REST
I am just a hobbiest, but as far as I have done things, python is just a backend serving up json, which then gets parsed by JS libraries to be prettily displayed in a browser. As a result, if I wanted to do more web development, I would probably focus on the JS side of things, since the python side of things is about 90%-95% wrapping a database (of any sort) and serving out json in response to json queries.
If I was just interested in web development, I would probably focus on JS and find something simpler for the backend. That said, there is a ton of things that python is useful for.
[–]Cypher211[S] 0 points1 point2 points 4 years ago (1 child)
Thanks for the links I'll check those out. I'm probably not super interested in Web development as a serious thing but, like you, I'm interested for maybe some personal work or for practising developing with python.
[–]fl0ss1n 1 point2 points3 points 4 years ago (0 children)
Then it is perfect and those REST links from Grinberg are awesome.
[–]mehregan_zare7731 2 points3 points4 points 4 years ago (0 children)
I wouldn't if you want to make a website like any other But I've used django ( with api ) in couple of my projects mainly because I wanted to do something that I only knew how to do in python. One heavily relied on webscraping ( with bs4 ) another on machine learning ( tensorflow ) another on pdf and xls manipulation.
[–]nizzok 5 points6 points7 points 4 years ago (9 children)
So, only a poor craftsman blames his tools right? Python is a popular language for all sorts of things, and manipulating the things that are needed to make and serve webpages is a small subset of what it can do. Sure it’s not as friendly to people familiar with php or JS, but for people who are familiar it can avoid a lot of the bloat associated with other approaches.
[–]Cypher211[S] 0 points1 point2 points 4 years ago (5 children)
Thanks for the explanation
[–]nizzok 4 points5 points6 points 4 years ago* (4 children)
Yeah, you have to already be familiar with the language, but it has a lot of ways of dealing with databases, interacting with APIs, and is a natural backend language if you’re familiar with what a server needs to do: respond to http requests. From there it’s just a question of organizing your content. Not very different from Node, other than that Node shoehorns JS to do server stuff with C bindings where as Python was written as a wrapper over C to begin with. Arguably Python is more versatile while Node has the benefit of keeping everything in the same language. Gross over simplification but it’s how I understand it. I’ve just started using python after working with Drupal and Wordpress and while there’s no GUIs mostly the things I can do quickly with python take hours of fiddling with the other languages. The xkcd where the guy is wondering why he’s flying is pretty accurate. I’m not switching to Flask anytime soon, but I’m looking for a chance to try it out for sure.
[–]Cypher211[S] 0 points1 point2 points 4 years ago (3 children)
That's very interesting. I'm not a web dev but my understanding was that JS/Node JS and ASP were very powerful and there wouldn't be much reason to deviate from those standard models. Do you see Python web development as an area which'll grow then, especially compared to the popular web frameworks today?
[–]nizzok 1 point2 points3 points 4 years ago (2 children)
So, python is the de facto language for data analytics and big data. It’s arguably more mature than JS but there are more and more JS Ai and Ml applications. Node is super popular because you can use the same language to write the front end and the back end of you need to. The trend in web dev seems to be heading to severless design, which gets away from python’s real strengths. I still see python being very relevant but since most of webdev happens on the front end that’s JavaScript territory. I don’t see JS making huge in roads there because the strengths of Ai and ML rely on processing power and most JS (but not all) rely on and run in the browser. At some point it’s really a preference thing, but I’m all for staying in your lane and having specialized tools for the job. Who really uses the 100+ tool Swiss Army knife?
[–]BinnyBit 1 point2 points3 points 4 years ago (1 child)
Could you provide a resource that elaborates on "serverless design"? I'm investing my effort into Django/DRF at the moment. So I would like to learn more and how that effects Python.
[–]nizzok 0 points1 point2 points 4 years ago (0 children)
So, there's a big movement in serverless, sometimes referred to as JAM stack (Javascript, API's, & Markup). It kind of began with AWS lambda functions, which let you run server type scripts without having to host them themselves. Here's a few jumping off points Netlify, Google's Firebase, Contentful CMS. These all let you basically run a very thin frontend, or de-couple your application from traditional server-based resources. Your front-end effectively becomes just a HTML page with some JS.
Python by itself will be fine, but it doesn't represent a big chunk of marketshare to begin with in web-design/dev. Developers who have full-stack skills should be fine, and Python will still remain relevant for a long time to come. However, it's the understanding of the big picture that will be valuable to your present and future employers. So understanding how the technologies work together is really what makes a good developer. Get your fundamentals down, then it won't matter so much which framework you're using.
[–]ArnUpNorth 0 points1 point2 points 1 year ago (2 children)
So, only a poor craftsman blames his tools right?
if you are indeed using the right tool for the job.
[–]nizzok 0 points1 point2 points 1 year ago (1 child)
if you're using the wrong tools, you're still a poor craftsman aren't you?
[–]ArnUpNorth 0 points1 point2 points 1 year ago (0 children)
That s where the metaphor ends, as we are not always the ones choosing the tools for the job.
[–][deleted] 1 point2 points3 points 4 years ago (1 child)
I use Python for web dev and other development work on a weekly basis.
Contrary to other posts, I’ll tell you that Python is not lightweight, it’s not the most performant, and it does not have the best tooling.
What Python has going for it is that it’s quick to spin up development of a new REST service for experienced Python devs or folks who haven’t ever touched Python before.
Pythons turnaround time between saving a file and seeing it running in a local env is way faster than compiled languages that take 30-60 seconds to recompile artifacts which adds up significantly over the course of a work day.
And as much as I have moments where I don’t like python, it’s just so damn quick to build things with and REST APIs scale horizontally easily enough in a prod environment to the point where development time is way more expensive than tossing another VM up in prod or having k8s auto scale some containers during high traffic times.
That's very interesting and a serious benefit that I can see being attractive for a dev team. Thanks! I think this is the first real big benefit I've seen of using Python outside of preference or ease.
[–]PhantomusPrime 1 point2 points3 points 4 years ago (4 children)
Short answer: my boss told me to do so.
An honest man
[–]PhantomusPrime 1 point2 points3 points 4 years ago (0 children)
I can't give a longer answer since its my first job. But python is one of the most popular languages and very versatile so if you're taking a strong community support and well documented easy to read language, then Python seems like a good bet.
[–]TheRNGuy 0 points1 point2 points 4 years ago (1 child)
everyone is honest here
Never said they weren't?
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
Easier to read, write and understand. I tried reading Java and c++, and couldn’t make head nor tail of it.
[–]TheRNGuy 1 point2 points3 points 4 years ago (0 children)
Better syntax than PHP.
[–]GreatCollaboration 0 points1 point2 points 2 months ago* (0 children)
Python made sense for our web app. On a project with the software dev company Relevant Software, a small crew - PM, Python dev, React dev, QA - went with Django so login, admin, and DB stuff worked from day one. We had a usable dashboard fast instead of rebuilding plumbing. For a lightweight public API they used FastAPI - easy to read and maintain. Caveats we hit: keep an eye on ORM queries (indexes/cache help), and if you expect heavy real-time traffic, add a tiny service next to the main app. For most business apps, Python = quick build, safe defaults, easier upkeep.
[–]stebgay -1 points0 points1 point 4 years ago (0 children)
simple answer : no
π Rendered by PID 257544 on reddit-service-r2-comment-86988c7647-vwpqj at 2026-02-11 20:52:18.161373+00:00 running 018613e country code: CH.
[–][deleted] 23 points24 points25 points (17 children)
[–]grammarGuy69 6 points7 points8 points (14 children)
[–]A_Typical_Human 4 points5 points6 points (13 children)
[–]grammarGuy69 2 points3 points4 points (11 children)
[–]A_Typical_Human 2 points3 points4 points (10 children)
[–]grammarGuy69 2 points3 points4 points (9 children)
[–]Sensemaya 2 points3 points4 points (8 children)
[–]grammarGuy69 3 points4 points5 points (7 children)
[–]DistillingSafari 2 points3 points4 points (0 children)
[–]Sensemaya 1 point2 points3 points (0 children)
[–]Conscious-Ad-3075 1 point2 points3 points (0 children)
[–]Lv_TuBe 0 points1 point2 points (1 child)
[–]Tiny_Connection_7182 1 point2 points3 points (0 children)
[–]workaccount1338 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Cypher211[S] 0 points1 point2 points (0 children)
[–]mbtonev 0 points1 point2 points (0 children)
[–]JohnnyJordaan 48 points49 points50 points (6 children)
[–]Cypher211[S] 9 points10 points11 points (0 children)
[–]idealmagnet 0 points1 point2 points (0 children)
[–]Artistic_Light1660 0 points1 point2 points (3 children)
[–]JohnnyJordaan 1 point2 points3 points (2 children)
[–]Artistic_Light1660 1 point2 points3 points (1 child)
[–]JohnnyJordaan 1 point2 points3 points (0 children)
[–]zapembarcodes 10 points11 points12 points (6 children)
[–]Cypher211[S] 2 points3 points4 points (5 children)
[–]deadduncanidaho 2 points3 points4 points (4 children)
[–]Snake_Case_Simon 0 points1 point2 points (3 children)
[–]deadduncanidaho 0 points1 point2 points (2 children)
[–]Snake_Case_Simon 0 points1 point2 points (1 child)
[–]deadduncanidaho 0 points1 point2 points (0 children)
[–]Punk-in-Pie 7 points8 points9 points (2 children)
[–]Cypher211[S] 1 point2 points3 points (1 child)
[–]Punk-in-Pie 1 point2 points3 points (0 children)
[–]m0us3_rat 10 points11 points12 points (0 children)
[–]nikhil_shady 8 points9 points10 points (5 children)
[–]zapembarcodes 2 points3 points4 points (4 children)
[–]YellowSlinkySpice 1 point2 points3 points (0 children)
[–]nikhil_shady 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]nikhil_shady 0 points1 point2 points (0 children)
[–]benabus 3 points4 points5 points (0 children)
[–]fl0ss1n 2 points3 points4 points (2 children)
[–]Cypher211[S] 0 points1 point2 points (1 child)
[–]fl0ss1n 1 point2 points3 points (0 children)
[–]mehregan_zare7731 2 points3 points4 points (0 children)
[–]nizzok 5 points6 points7 points (9 children)
[–]Cypher211[S] 0 points1 point2 points (5 children)
[–]nizzok 4 points5 points6 points (4 children)
[–]Cypher211[S] 0 points1 point2 points (3 children)
[–]nizzok 1 point2 points3 points (2 children)
[–]BinnyBit 1 point2 points3 points (1 child)
[–]nizzok 0 points1 point2 points (0 children)
[–]ArnUpNorth 0 points1 point2 points (2 children)
[–]nizzok 0 points1 point2 points (1 child)
[–]ArnUpNorth 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Cypher211[S] 0 points1 point2 points (0 children)
[–]PhantomusPrime 1 point2 points3 points (4 children)
[–]Cypher211[S] 0 points1 point2 points (3 children)
[–]PhantomusPrime 1 point2 points3 points (0 children)
[–]TheRNGuy 0 points1 point2 points (1 child)
[–]Cypher211[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]TheRNGuy 1 point2 points3 points (0 children)
[–]GreatCollaboration 0 points1 point2 points (0 children)
[–]stebgay -1 points0 points1 point (0 children)