Day 91 – Working with Templates in Django Today I learned how Django handles the frontend using Templates and how everything connects from URL to the final HTML page rendered in the browser. 🔹 What are Templates? Templates are the HTML pages in Django that define the frontend UI of a web application. 🔹 What I Did Today ✔️ Created Templates Folder Inside my app, I created a folder named templates (naming is important for Django to recognize it) ✔️ Linked Templates Configured the TEMPLATES setting in settings.py by adding 'templates' inside the DIRS list ✔️ Created HTML Page Built a simple index.html page inside the templates folder ✔️ Created View Function In views.py, created a function: return render(request, 'index.html') → This is how Django sends HTML to the browser ✔️ Connected URLs to Views Mapped the function in urls.py using: path('', views.index) 🔹 How It Works (Flow) 👤 User → URL ➡️ urls.py checks the path ➡️ Calls the function in views.py ➡️ render() loads the HTML page ➡️ Template is displayed in browser 🎉 🔹 Key Takeaway Django follows a clear flow: URL → View → Template Understanding this connection makes it much easier to build dynamic websites step by step. Learning how backend connects to frontend feels like unlocking the real power of web development 🔥 #Django #Python #WebDevelopment #Frontend #Backend #FullStackDevelopment
Django Templates and Frontend UI
More Relevant Posts
-
Day 8 - React? Next.js? Nah. I built a full news aggregator with Django templates. Server-side rendering. Zero JavaScript. Real API data. 🚀TechFromZero Series - DjangoFromZero 🌐 Try it live: https://lnkd.in/dPHzUe8P This isn't a Hello World. It's a real server-rendered news aggregator: 📐 GNews API → Django Views → Templates → HTML → Browser (zero JS, full SSR) 🔗 The full code (with step-by-step commits you can follow): https://lnkd.in/dgPCtex7 🧱 What I built (step by step): 1️⃣ Project scaffold — Django project with config/ layout and .env secrets 2️⃣ Settings deep dive — env vars, WhiteNoise, template dirs, static files 3️⃣ News app — Django's modular app architecture with AppConfig 4️⃣ GNews API client — isolated external API calls in one file 5️⃣ Home page — template inheritance, function-based views, dark theme CSS 6️⃣ Article detail — custom |timeago template filter, URL parameters 7️⃣ Search + categories — GET params, path routing, category pills 8️⃣ Production polish — custom 404, CSRF, SSL proxy headers 9️⃣ Render deploy — gunicorn, collectstatic, render.yaml as Infrastructure as Code 🔟 Full README — quickstart, architecture diagram, step-by-step guide 💡 Every file has detailed comments explaining WHY, not just what. Written for any beginner who wants to learn Django by reading real code — with full clarity on each step. 👉 If you're a beginner learning Django, clone it and read the commits one by one. Each commit = one concept. Each file = one lesson. Built from scratch, so nothing is hidden. 🔥 This is Day 8 of a 50-day series. A new technology every day. Follow along! 🌐 See all days: https://lnkd.in/dhDN6Z3F #TechFromZero #Day8 #Django #Python #ServerSideRendering #GNewsAPI #Render #LearnByDoing #OpenSource #BeginnerGuide #100DaysOfCode #CodingFromScratch
To view or add a comment, sign in
-
-
Day 15/30 – Python Challenge 🐍 🚀 Excited to share my latest Full-Stack Django Blog Website Project built using Python, Django, SQLite, HTML, CSS, and Bootstrap. Over the past few days, I worked on building a modern blog platform from scratch and learned a lot about Django project structure, routing, templates, and authentication. ✨ Features completed so far: ✅ Django project and app setup ✅ Blog post model with image upload support ✅ Home page with all latest blog posts ✅ Dynamic blog detail page ✅ Beautiful Bootstrap card-based UI ✅ Responsive navbar and footer ✅ Media file configuration ✅ User Signup / Login / Logout Authentication ✅ Session-based navbar updates ✅ Admin panel integration 💡 This project helped me strengthen my understanding of: 🔹 Django MVT architecture 🔹 URL routing and views 🔹 Template rendering 🔹 Model creation and migrations 🔹 Authentication system 🔹 Bootstrap frontend integration 🔹 Static and media file handling Building this project step-by-step gave me strong confidence in full-stack web development with Django. Next, I’m planning to add: 🚀 Create Post for logged-in users 🚀 Update/Delete functionality 🚀 Author dashboard 🚀 Search and categories 🚀 Deployment Would love to hear your feedback and suggestions 🙌 #Python #Django #WebDevelopment #FullStackDevelopment #Bootstrap #SQLite #SoftwareEngineering #100DaysOfCode #CodingJourney #OpenToWork #LinkedInProjects
To view or add a comment, sign in
-
Just like opening the door, Django web framework gives access. But before that, Happy Easter Monday. I am believing that you have make out time to enjoy yourself and make good use of the holiday. Perhaps in you location you do not have holiday don't worry your time will soon come. I have been away for some time. Really, I have been working on a number of projects offline which actually kept me away all these while, But I want to really appreciate every one of you who make out time to check on me. I am overwhelmed by such a wonderful sense of belonging. Indeed, I am so pleased to have you as my trip Sharing today is unlocking the power of Django API with DRF. This sound interesting right? One of the ways to have a modern web app built is using Django. Using this framework is an easy way to have a seamless connection with both backend interacting with frontend. This results in a fantastic UX. The Django REST framework DRF is the answer to making an appealing and powerful interaction. You can quickly build flexible API that form a bridge, which allows a smooth data exchange framework with a cutting- edge dynamic user experience. Whether your work require creating a responsive web Application or wishing to integrate a third-party service, Python makes it easier to manage data and handle request authentication. How do you leverage DRF to take your Django project to the next level? Let me know which tool you use in handling data request from the backend how effective it is? #pythonprogramming #Djangowebframework #Datarequest #authentication
To view or add a comment, sign in
-
-
Day 93 – Multi-Page Setup, Template Inheritance & Static Files in Django Today was a big step forward! I learned how to build multiple pages, reuse layouts using template inheritance, and manage static files (CSS, JS, Images) in Django 🔥 🔹 Multi-Page Setup ✔️ Created multiple pages: index.html, about.html, contact.html ✔️ Wrote separate functions in views.py for each page ✔️ Connected them using urls.py 👉 Navigation works using: localhost/about | localhost/contact 🔹 Template Inheritance (Powerful Feature 💡) ✔️ Created a parent (base) HTML page ✔️ Used: {% block title %} & {% block content %} ✔️ Extended in child pages using: {% extends 'base.html' %} 👉 Result: Reusable layout (Navbar, Footer, etc.) across all pages 🔹 Dynamic Navbar with URL Mapping ✔️ Added name='' in urls.py ✔️ Linked pages using: {% url 'name' %} 👉 Clean navigation without hardcoding URLs 🔹 Static Files (CSS, JS, Images) ✔️ Created a static folder (css, js, images) ✔️ Linked in settings.py using STATICFILES_DIRS ✔️ Loaded static in HTML: {% load static %} ✔️ Linked CSS: <link rel="stylesheet" href="{% static 'css/style.css' %}"> ✔️ Added Images: <img src="{% static 'images/img.jpg' %}"> 🔹 Key Takeaway Django becomes much more powerful when we: ✨ Reuse layouts with inheritance ✨ Organize pages cleanly ✨ Manage static files efficiently This is where real website structure starts forming 💻🔥 #Django #Python #WebDevelopment #FullStackDevelopment #Frontend #Backend #LearningJourney
To view or add a comment, sign in
-
-
Stop treating your JavaScript like a stranger to your Django backend. 🛑 Most developers default to putting all JS in a /static/ folder. It’s clean, sure. But you’re missing out on a massive Django superpower: Server-side templating inside your scripts. By embedding JavaScript directly into your HTML templates instead of a static file, you let Python and JS work hand-in-hand. Why this is a game-changer: No more hidden APIs: Stop building "dummy" endpoints just to pass a single variable to a script. Context is King: Use {{ request.user }} or {{ object.id }} directly inside your JS logic. Dynamic Logic: Use Django if/else tags to include or exclude entire blocks of frontend code based on backend permissions. Zero Latency: Your data is there the moment the page loads. No "loading" spinners while waiting for an extra AJAX call. It’s not "messy"—it’s integrated. Are you team "Keep them separate" or team "Template everything"? Let's debate in the comments! 👇 #Django #Python #WebDevelopment #JavaScript #CodingTips #FullStack
To view or add a comment, sign in
-
-
A document maker that can produce pure static HTML with less than 15KB of JavaScript. The tool is called docmd — and it’s not a documentary framework based on React. It takes Markdown files, creates fast static HTML, integrates search-ready, themes, and live edits — with no hydration lag like React apps. Features that are available: → No configuration needed — just docmd init and start writing Markdown → Completely static HTML output — no SPA, no React, no hydration on client side → Search integrated full-text offline, with fuzzy matching — no Algolia, no API key → Live editor on browser — write and preview immediately without server → Rich content support — Callout, Cards, Tabs, Steps, Changelog and Mermaid charts → Have morning/evening mode and many themes (sky, ruby, retro) → Run on Node.js CLI, pipeline CI/CD or directly in browser A quick comparison: Docusaurus — React SPA, heavy JS bundle, takes ~15 minutes to setup MkDocs — Python, JS minimalist, ~10 minutes to setup docmd — stable HTML, <15KB JS, ~1 minute to setup
To view or add a comment, sign in
-
-
Day 61 of #90DaysOfCode Today I built a multi-page blog website using Flask and the Bootstrap Clean Blog template. The project demonstrates how Flask can structure a web application using reusable templates and multiple routes. How the application works • Flask handles routing for Home, About, and Contact pages • Templates are rendered dynamically using render_template • Shared layout components like header and footer are reused with Jinja includes • Static assets such as CSS, images, and scripts are served through Flask Key concepts explored • Flask routing for multi-page applications • Template reuse with Jinja • Integrating Bootstrap UI with Flask • Organizing static assets and templates This project helped reinforce how backend frameworks organize maintainable and scalable web applications. GitHub Repository https://lnkd.in/gAHWhnVT #Python #Flask #WebDevelopment #BackendDevelopment #SoftwareEngineering #90DaysOfCode
To view or add a comment, sign in
-
😱 My package blew up, but I’m not even mad about it. If you’ve worked with reusable components in React, you already know how powerful that pattern is. Now imagine bringing that same idea into Django templates — and even your admin interface. That’s essentially what Django Palette does. It’s not just a templating helper — it’s a full admin UI framework with Bootstrap styling, reusable components, and custom template tags that let you build clean, dynamic interfaces inside Django. Instead of repeating HTML across your project, you define components once and reuse them anywhere. You can pass dynamic data, and even override specific sections when needed — similar to how slots work in modern frontend frameworks. It ends up feeling a lot like working with components in React or Vue, but without leaving Django. For projects that start simple but scale fast, this kind of structure makes a real difference — your templates stay clean, your UI stays consistent, and your admin stops looking like it’s stuck in 2010. You can check it out here: - GitHub: https://lnkd.in/ebrAZj4D - Documentation: https://lnkd.in/ekrCgxsN - Python Package Index: https://lnkd.in/esSceHyY #Django #Python #WebDevelopment #Frontend #FullStack #SoftwareEngineering #CleanCode #DeveloperExperience #SaaS
To view or add a comment, sign in
-
Django doesn't have a feature problem. It has a marketing problem. Django Fellow Sarah Boyce broke down the three myths keeping developers away from one of Python's most powerful frameworks. Myth 1: Django is in maintenance mode The website and tutorial haven't changed much in 10 years, so people assume nothing else has. On average: • New features ship every 8 months. • A new feature is merged every 5.5 days. • 20 commits land every week. The code is stable because of a deliberate stability policy. That's a feature, not a sign of neglect. Myth 2: Django is slow Common public benchmarks compare a batteries-included Django against a minimal FastAPI setup. That's not apples-to-apples. Add to that: • Django includes more out-of-the-box features (security, middleware, etc.). • Benchmarks are often run on outdated versions. • For almost every dynamic web app, the database is the performance bottleneck, not the framework. Django has excellent tools for optimizing that. Myth 3: Django is only for server-rendered HTML Django's official docs and 8-part tutorial don't mention APIs once, so naturally, people assume it can't do them. The reality: • Over half the Django community uses it for APIs. • Django REST framework, Django Ninja, and the brand-new Django Bolt (built on Rust) are all thriving. So why do the myths persist? Django is run almost entirely by volunteers who love the framework, but programmers aren't marketers. The website, the docs, and the messaging haven't kept up with what Django actually is in 2025. The good news is that a Django marketing working group is forming. If you have skills or time to contribute, now's the moment. The key takeaway: Django isn’t outdated, slow, or limited. It’s just not loud about what it does well. Watch the full talk: https://lnkd.in/d7QHmJ2j #Django #Python #WebDev
To view or add a comment, sign in
-
True and it’s great to see that Django will have a marketing team. Experienced developers may use Django all the time, but for newer developers, it can feel unappealing compared to how other frameworks are marketed. #django #python #pycharm
Django doesn't have a feature problem. It has a marketing problem. Django Fellow Sarah Boyce broke down the three myths keeping developers away from one of Python's most powerful frameworks. Myth 1: Django is in maintenance mode The website and tutorial haven't changed much in 10 years, so people assume nothing else has. On average: • New features ship every 8 months. • A new feature is merged every 5.5 days. • 20 commits land every week. The code is stable because of a deliberate stability policy. That's a feature, not a sign of neglect. Myth 2: Django is slow Common public benchmarks compare a batteries-included Django against a minimal FastAPI setup. That's not apples-to-apples. Add to that: • Django includes more out-of-the-box features (security, middleware, etc.). • Benchmarks are often run on outdated versions. • For almost every dynamic web app, the database is the performance bottleneck, not the framework. Django has excellent tools for optimizing that. Myth 3: Django is only for server-rendered HTML Django's official docs and 8-part tutorial don't mention APIs once, so naturally, people assume it can't do them. The reality: • Over half the Django community uses it for APIs. • Django REST framework, Django Ninja, and the brand-new Django Bolt (built on Rust) are all thriving. So why do the myths persist? Django is run almost entirely by volunteers who love the framework, but programmers aren't marketers. The website, the docs, and the messaging haven't kept up with what Django actually is in 2025. The good news is that a Django marketing working group is forming. If you have skills or time to contribute, now's the moment. The key takeaway: Django isn’t outdated, slow, or limited. It’s just not loud about what it does well. Watch the full talk: https://lnkd.in/d7QHmJ2j #Django #Python #WebDev
To view or add a comment, sign in
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