Frontend vs backend: where Python stops
Good news: you may never need to write frontend code. But the backend is a different story, and here is where the line between them sits.
In this post, you will learn the difference between frontend and backend, and where exactly Python fits into a web application. This split is the basic map of how every website and app is built, and once you can see it, a whole category of confusing questions answers itself.
Last week you learned how to turn a function into an API, and when you opened it in the browser, you got something like {"password": "NlDRymnljPanqFp2"}. Perhaps a part of you was slightly disappointed by that. Real websites do not look like raw JSON. They have buttons, colors, input fields, animations. So where does all of that come from, and why did your Python produce none of it?
The answer is that every web application is actually two programs, running on two different computers.
The two halves
One program runs in the browser, on the visitor’s machine. It is written in HTML, CSS, and JavaScript, and its job is everything you can see and touch. This half is called the frontend.
The other program runs on a server, which as we have said before is simply a computer that stays on. Its job is the data and the logic. This half is called the backend, and this is where your Python lives.
Here is the part that surprises most beginners: Python never runs inside the browser. Browsers only run one programming language, and that language is JavaScript. So when you wonder why your Python script cannot change a button color on a page, the answer is that your Python is not there. It is on the other side of the border, on the server, and the only thing that crosses that border is HTTP requests going one way and data coming back the other way.
What actually happens when you click a button
Let’s make this concrete with a scenario. Imagine a weather website. You type “Lagos” into a search box and click Search. Here is the full trip:
JavaScript in your browser notices the click and sends a request, something like GET /weather?city=Lagos. If that shape looks familiar, it should, because it is exactly how you called your own password API last week. The request travels to the server, where the Python backend runs: it might check a database, or call an external weather service using an API key. Then it sends back JSON, something like {"temp": 24, "sky": "clear"}. Finally, JavaScript receives that JSON and turns it into pixels: a big 24°C and a sun icon.
So the ugly JSON you saw last week was not a limitation. It is the handshake between the two halves. Backends speak data, and frontends turn data into things you can look at.
Who does what, and why it matters
The division of labor is fairly clean. The browser handles everything that needs to feel instant: layouts, hover effects, reacting while you type. The server handles everything that involves data and trust: the real logic, the database, and the secrets.
That word “trust” deserves a moment. Everything in frontend code is visible to every visitor. Anyone can right-click your page, choose View Source, and read all of it. So if you place an API key in JavaScript, you have published it to the internet. This is one of the most common beginner mistakes out there, and it is why secrets always stay on the backend, where visitors cannot see them.
Do you need to learn frontend now?
My answer is no, and the reason is different than it would have been three years ago. Today you can let AI write your frontend. Describe the page you want, and tools like Claude or Cursor will produce the HTML, CSS, and JavaScript for you in a minute. Frontend is also where AI shines the most, because you can immediately judge the result with your own eyes: the button is either blue or it is not.
The backend is a different story. AI can write that code too, and I encourage you to let it. However, the backend is where the logic of your app lives: what gets saved, who is allowed to do what, what happens when a payment fails. Those are decisions, not code, and AI cannot make them for you. If you do not understand your backend, you do not understand your app. That is why you are learning Python, and not CSS.
This is also why I believe there has never been a better time to learn Python. The frontend used to be a wall: you either learned a second craft or hired a frontend developer. Now AI fills that gap for free, and one person with Python and a clear picture of the logic can ship a complete app alone. The map from this post is what lets you direct the AI, because you know which half a feature belongs to, and which half a bug lives in.
One more thing: this map is not just for websites. Every app on your phone works the same way. The app itself is a frontend, and somewhere a server is running someone’s backend code. Two programs, one handshake. You now have the whole picture.
If you learned something from this today, consider upgrading for the full experience: every weekly project with full source code, plus the complete archive. Since you read this far, I’d like to offer you 35% off the annual plan as a token of appreciation. Click below to get the discount:







Good explanation.
I will like to see a project whereby we use HTML/CSS/JS for the frontend and Python largely for the Backend. It should span beginner to advanced.
Writing this now and I have this feeling you would have done it. Let me search through 😊
Hi Ardit,
Please see this post based on our discussions. You are a 10X Tech Lead and I am not.
Please share your impressions on this post.
Thanks,
Steve
https://eventzlaw.substack.com/p/eventz-is-not-a-database-a-fold-or?r=pq9um&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true