Ever felt confusion between *args and **kwargs in Django? Here’s the answer: 1) *args is that quiet friend who just brings extra unnamed stuff to the party. You don’t ask questions, you just accept and pass it along. 2) **kwargs is the organized one. Everything comes labeled. “Here’s pk, here’s slug.” Clean, structured, useful. >In Django, URL data always arrives via **kwargs. That’s your goldmine. Use it. >*args? Mostly just forward it. Don’t overthink. Rule: Read from **kwargs, pass both. Master this and your views stop breaking like your sleep schedule during exams. #django #python #coding #backend #development
Django args vs kwargs: A Simple Explanation
More Relevant Posts
-
Today I learned something powerful while building my backend with Django At first, I thought all text fields were the same… but I quickly realized that’s not the case. ✅ CharField is best for short text (like names, titles, etc.) ✅ TextField is designed for longer content (like user complaints or descriptions) That small difference can actually affect how flexible and scalable your application becomes. But what really stood out to me was this: ✅ ForeignKey allows you to connect different parts of your system together. Instead of storing random text like a user’s name, you can link an appointment directly to: * A real user * A real doctor This makes your system: ✅ More structured ✅ More reliable ✅ Closer to real-world applications I’m currently building a system where appointments are no longer just data they represent real relationships between users and doctors. Small concepts… big impact 🚀 #Django #BackendDevelopment #WebDevelopment #SoftwareEngineering #LearningInPublic #Python #APIs
To view or add a comment, sign in
-
-
Behind every "simple" checkout button is a mountain of logic. 🏗️ I’ve spent the last few weeks deep in the world of MedusaJS and Django REST Framework, and if there’s one thing I’ve learned, it’s that the "invisible" parts of an app are often the most important. Whether it’s mapping out a clinical hierarchy for a pharmacy system or building out meeting session modules, the goal is always the same: clean, scalable code that makes the frontend look effortless. It’s been a season of learning, debugging, and building. Onward! 🚀 #BackendDevelopment #Python #Django #MedusaJS #WebDevelopment
To view or add a comment, sign in
-
-
⚡ Flask vs FastAPI — Which one should you choose? As a Python backend developer, I’ve worked with both Flask and FastAPI, and here’s a simple breakdown 👇 🔹 Flask ✔️ Lightweight and flexible ✔️ Easy to get started ✔️ Great for small to medium applications 🔹 FastAPI ✔️ High performance (async support) ✔️ Built-in request validation (Pydantic) ✔️ Automatic API documentation (Swagger UI) 👉 My takeaway: - Use Flask when you need simplicity and quick development - Use FastAPI when performance and scalability matter Both are powerful — it’s not about which is better, but which fits your use case. 💬 What do you prefer — Flask or FastAPI? #Python #BackendDevelopment #FastAPI #Flask #SoftwareEngineering #APIs
To view or add a comment, sign in
-
-
5 books. 6 database trips. That's your Django app bleeding performance. Most of the time we never notice the N+1 problem — until their app slows down under real data. Here's the fix explained as a story (swipe through) 👇 𝗦𝗹𝗶𝗱𝗲 𝟭 — You have 5 books. Each has an author. Simple. 𝗦𝗹𝗶𝗱𝗲 𝟮 — Without optimization: Django makes 6 separate DB trips. One per book. Painful. 𝗦𝗹𝗶𝗱𝗲 𝟯 — select_related() fixes it with a single JOIN. 1 trip. Everything together. 𝗦𝗹𝗶𝗱𝗲 𝟰 — But JOIN breaks with tags — Book 1 repeats 3 times. Messy. 𝗦𝗹𝗶𝗱𝗲 𝟱 — prefetch_related() makes 2 smart trips. Python glues them in memory. 𝗦𝗹𝗶𝗱𝗲 𝟲 — The rule: ONE thing → select_related. MANY things → prefetch_related. That's it. Two methods. One simple rule. #Django #Python #WebDevelopment #BackendDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
Django vs FastAPI is not a debate. It's a use case question. Django when you need: Admin panel out of the box ORM, auth, migrations all bundled A monolith that ships fast A team that doesn't want to wire things together FastAPI when you need: High throughput async APIs Full control over every layer ML model serving or agentic backends Type safety and auto docs without extra setup Django is a framework that makes decisions for you. FastAPI is a framework that trusts you to make them. Neither is better. Wrong tool for the job is the only mistake. #Python #Django #FastAPI #BackendDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
🛠️ One unexpected thing I'm starting to enjoy in Django: Debugging. Not because errors are fun. But because they force me to think. Earlier: Errors = frustration Now: Errors = clues Every bug teaches me: How the system actually works Where my logic breaks What I misunderstood Honestly, fixing a bug feels more satisfying than writing new code. That's when I realized: backend development isn't just about building things, it's about understanding why they break. Have you started enjoying debugging too, or is it just me? 😅 #Django #BackendDevelopment #Python #LearningInPublic
To view or add a comment, sign in
-
-
Why FastAPI is the modern choice for Python devs? If you are still building APIs the "old way," you are leaving performance and developer happiness on the table. Here is why FastAPI is taking over the ecosystem in 2026: 🚀 1. Speed that rivals Go and Node.js Thanks to Starlette and Pydantic, FastAPI is one of the fastest Python frameworks available. It handles thousands of concurrent connections using native async/await. 🛠️ 2. No more manual Documentation Forget writing Swagger files by hand. FastAPI generates interactive docs at /docs automatically. Your frontend team will thank you. 🛡️ 3. Production-Ready Type Safety By leveraging Python Type Hints, FastAPI validates your data before it even reaches your logic. If the input is wrong, it handles the error for you. Are you still on Team Django/Flask, or have you made the switch to FastAPI? Let’s discuss below! 👇 #Python #FastAPI #WebDevelopment #Backend #SoftwareEngineering #CloudComputing
To view or add a comment, sign in
-
-
Finding and downloading O/A Level past papers takes way too much time. To fix this, I built a tool to completely automate the process for students and teachers! Instead of clicking through endless ads and folders, you just select your subject, years, and variants. The tool automatically fetches the exact PDFs, compiles them, and serves them in a single ZIP file. Check out the real-time, mathematically accurate download progress bar in the demo below! The Tech Stack: Frontend: React.js & Vite Backend: Python & FastAPI If you are dealing with CAIE exams or resource compilation, I built this to save you hours. Would love to hear your feedback in the comments! #WebDevelopment #ReactJS #FastAPI #Python #EdTech #SoftwareEngineering #ALevels #OLevels
To view or add a comment, sign in
-
Day 12 of my Python Full Stack journey. ✅ Today's topic: Functions Deep Dive — the parts most beginners skip. *args and **kwargs. Looked confusing at first. Made complete sense after 45 minutes. Here's what I typed today: # Default arguments def greet(name, role="Developer"): print(f"Hey {name}, future {role}!") # *args — multiple positional arguments def add_all(*numbers): return sum(numbers) print(add_all(1, 2, 3, 4)) # 10 # **kwargs — multiple keyword arguments def show_info(**details): for key, value in details.items(): print(f"{key}: {value}") show_info(name="Punith", city="Bangalore", stack="Python") Why this matters for Django: → Django views use *args and **kwargs everywhere → Every class based view passes **kwargs automatically → Understanding this now saves hours of confusion later Pushed to GitHub immediately. Lesson learned. ✅ #PythonFullStack #Day12 #BuildingInPublic #100DaysOfCode #Bangalore
To view or add a comment, sign in
-
-
Quick backend progress update: Over the last couple of days I moved from basic Django concepts into actually structuring a multi-page app. Built with Django: • Created reusable templates using Jinja2 • Used template inheritance/components to generate multiple webpages • Routed project-level "urls.py" into app-level routing • Added routes to serve templated pages cleanly Also spent time strengthening fundamentals: • Studied types of Operating Systems • Solved linked list problems for DSA practice One thing I’m noticing: Building backend isn’t just “learning Django.” It’s understanding how multiple layers fit together: Routing Templates Data flow System fundamentals Problem solving Trying to build depth—not just stack tutorials. #BackendDevelopment #Django #Jinja2 #Python #OperatingSystems #DSA #LearnInPublic #SoftwareEngineering
To view or add a comment, sign in
More from this author
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development