Day 118-119 📘 Python Full Stack Journey – Django Models, Relationships & Media Handling Today I explored some advanced and exciting concepts in Django, moving closer to building real-world dynamic applications. 🚀 🎯 What I learned today: 🗄️ Multiple Models & Relationships Created a new Teacher model and linked it with Course using ForeignKey Understood how one-to-many relationships work in Django Used on_delete=models.CASCADE to automatically remove related data 💡 Learned how deleting a course also removes associated teachers — maintaining database integrity 🧩 Model Enhancements Used __str__() method to display meaningful names in Django Admin instead of default object names 🖼️ Image Handling in Django Used ImageField to upload images Installed Pillow for image processing Configured MEDIA_ROOT and MEDIA_URL to serve uploaded files Displayed images dynamically in templates 🌐 Dynamic Data Rendering Retrieved data using: Teacher.objects.all() Displayed data in templates using Django loops and variables Built a Teachers page showing: Name Course Image 📩 Forms & Models Created a Contact model for user data Introduced Django ModelForms to handle user input efficiently This session helped me understand how Django connects models, relationships, media files, and forms to build fully functional applications. Every step feels closer to building production-level web apps! 💻✨ #Django #Python #FullStackDevelopment #WebDevelopment #Backend #Database #CodingJourney #LearningToCode #Upskilling #TechSkills #ContinuousLearning
Django Models & Relationships: Building Dynamic Apps
More Relevant Posts
-
Day-122 📘 Python Full Stack Journey – Django Admin Customization & Form Feedback Today I explored how to enhance data presentation in Django Admin and improve user experience after form submission. 🚀 🎯 What I learned today: 📊 Admin Panel – Data Table View Customized Django Admin using ModelAdmin Displayed specific fields in a table format using: class ContactAdmin(admin.ModelAdmin): list_display = ('user_name', 'email_id', 'phone_number') This made the admin panel more structured and easier to manage data 💬 Popup / Response Page After Form Submission Created a popup (response) page to show feedback after form submission Updated views.py to: Validate and save form data Redirect or render a success page after submission if form.is_valid(): form.save() return render(request, 'popup.html') 💡 This improves user experience by confirming that the form was successfully submitted. This session helped me understand how to make applications more user-friendly and organized, both on the admin side and user-facing side. Step by step, building more complete Django applications! 💻✨ #Django #Python #FullStackDevelopment #WebDevelopment #Backend #AdminPanel #Forms #UIUX #CodingJourney #LearningToCode #Upskilling #ContinuousLearning
To view or add a comment, sign in
-
-
Day-123 📘 Python Full Stack Journey – Django CRUD (Create Operation) Today I started implementing CRUD operations in Django, beginning with the Create functionality by building an Employee Registration Form. 🚀 🎯 What I learned today: 🗄️ Model Creation Created an Employee model to store user data: Full Name Employee ID Phone Number Email ID 🌐 Form Creation (Manual HTML Form) Built a registration form using HTML Used: method="post" {% csrf_token %} for security Input validation with required attributes ⚙️ Handling Form Data in Views Captured user input using request.POST Created an object and saved data into the database: ob = Employee() ob.fullname = username ob.emp_id = empid ob.ph_no = phno ob.email_id = emailid ob.save() 🔗 Routing & Navigation Connected form via URL routing Added navigation link in base.html This session helped me understand how Django handles data creation from user input, a key part of real-world applications. Looking forward to implementing the remaining CRUD operations — Read, Update, and Delete! 💻✨ #Django #Python #FullStackDevelopment #WebDevelopment #CRUD #BackendDevelopment #CodingJourney #LearningToCode #Upskilling #ContinuousLearning
To view or add a comment, sign in
-
-
Day-129 📘 Python Full Stack Journey – Django Messages & Authentication Flow 🔐 Today I enhanced my Django application by implementing user feedback messages and complete authentication flow (Login & Logout). 🚀 🎯 What I learned today: 💬 Django Messages Framework Displayed success messages after signup using: messages.success(request, f'Account created for {username}!') Rendered messages in HTML using: {% if messages %} {% for message in messages %} <p style="color: green;">{{ message }}</p> {% endfor %} {% endif %} 💡 This improves user experience by giving instant feedback. 🔐 Login Using AuthenticationForm Used Django’s built-in AuthenticationForm Accessed form fields directly in template: {{ form.username }} {{ form.password }} Validated and authenticated users securely 🚪 Logout Functionality Implemented logout using: from django.contrib.auth import logout def logout_view(request): logout(request) return redirect('Login') Added logout route and link in UI ⚙️ Key Takeaways Improved user interaction with messages Built a complete authentication cycle (Signup → Login → Logout) Learned how Django handles sessions and user state This session made my application more user-friendly, secure, and complete. Excited to keep improving with protected routes and user-specific data next! 💻✨ #Django #Python #FullStackDevelopment #WebDevelopment #Authentication #Login #Logout #UserExperience #CodingJourney #LearningToCode #Upskilling #ContinuousLearning
To view or add a comment, sign in
-
-
📄⚙️ All-in-One PDF Toolkit using Django | Full-Stack Python Project I built a web-based PDF processing application using Django that allows users to perform multiple operations on PDF files in just a few clicks. 🔹 Features Implemented: ✅ Extract text from PDF files ✅ Rotate PDF pages ✅ Add custom watermark to PDFs ✅ View PDF metadata/details ✅ Merge two PDFs into one ✅ Encrypt PDFs with password protection 💻 Tech Stack: • Python • Django • PyPDF2 • ReportLab • HTML / CSS 💡 This project is part of my journey to convert Python scripts into real-world web applications using Django. Instead of running scripts locally, I’m now building interactive tools that users can access through a browser. It also helped me understand: File handling in web applications Backend processing with Django Working with binary streams (BytesIO) Building multi-functional tools in a single interface 🚀 Moving forward, I plan to integrate more advanced features and deploy these tools for real-world use. GitHub Repo: https://lnkd.in/dgCFWWTB #Python #Django #WebDevelopment #PDFTools #FullStackDevelopment #BackendDevelopment #Programming #BuildInPublic #SoftwareEngineering
To view or add a comment, sign in
-
Day-120,121 📘 Python Full Stack Journey – Django Forms & User Input Handling Today I learned how to handle user input in Django using models and forms — an important step toward building interactive and data-driven applications. 🚀 🎯 What I learned today: 🗄️ Model Creation (Contact Form) Created a Contact model to store user data: Name Email Phone number Applied migrations and registered the model in Django Admin for easy data management 📝 Django ModelForm Created a form using Django’s built-in ModelForm: class BookingContact(forms.ModelForm): class Meta: model = Contact fields = '__all__' Learned how Django automatically generates form fields from models 🌐 Displaying Forms in Templates Rendered forms in HTML using: {{ form }} {{ form.as_p }} for structured layout 📩 Form Submission (POST Method) Used POST method for secure data submission Added {% csrf_token %} for protection Handled form submission in views.py: if request.method == 'POST': form = BookingContact(request.POST) if form.is_valid(): form.save() 🎨 Custom Form Styling Styled individual form fields manually using labels and inputs Learned how to design forms for better user experience This session helped me understand how Django manages forms, validation, and database storage seamlessly — a key step in building real-world web applications. Excited to keep building more interactive features! 💻✨ #Django #Python #FullStackDevelopment #WebDevelopment #Backend #Forms #Database #CodingJourney #LearningToCode #Upskilling #ContinuousLearning
To view or add a comment, sign in
-
-
A Python package to clean Django project junk and free space. Over time, my projects kept filling up with things I don’t actually need… __pycache__, .pyc files, logs, staticfiles, even old virtual environments. Cleaning them manually every time was just… annoying 😅 So I made something simple to handle it. 🧹 Django Cleaner It scans your folders, detects Django projects automatically, and removes all the unnecessary stuff safely — without touching your actual code. You just run: django-cleaner ~/Projects and it does the rest. What it handles: • Removes __pycache__ and .pyc files • Cleans logs and staticfiles • Optional removal of venv • Shows how much space you freed I kept it simple on purpose. No setup, no complexity — just something useful that works. Published it on PyPI 📦 🔗 https://lnkd.in/gSvj5U3Y Code on GitHub 👇 🔗 https://lnkd.in/gNur8fN3 This is one of those small things that actually makes working on multiple projects easier. If you use Django, it might help you too. #Python #Django #OpenSource #BuildInPublic #SoftwareDevelopment #BackendDevelopment #DeveloperTools #Programming #Tech #CleanCode #Productivity #CodingLife
To view or add a comment, sign in
-
Flask vs Django — Which Python Web Framework Should You Choose? 🤔 If you're getting into web development with Python, you've probably come across both Flask and Django. While they serve similar purposes, they take very different approaches. 🔹 Flask is lightweight and flexible It gives you the freedom to build your app exactly the way you want. You choose your tools, structure, and components. Great for APIs, microservices, and smaller projects. 🔹 Django is full-featured and opinionated It comes with everything included — authentication, admin panel, ORM, and more. Perfect for building large, scalable applications quickly. 💡 Think of it like this: - Flask = build your own toolkit - Django = toolkit already built for you 🚀 When to use Flask - Prototyping ideas quickly - Building REST APIs - When you want full control 🏗️ When to use Django - Complex applications - Faster development with built-in features - Projects requiring scalability and security 👉 There’s no “better” framework — only the right one for your use case. What do you prefer — Flask or Django? And why? #Python #WebDevelopment #Flask #Django #Programming #SoftwareEngineering
To view or add a comment, sign in
-
-
Currently Learning & Building with Django REST Framework I am currently working on building REST APIs using Django REST Framework as part of my learning journey in backend development. How API works with Django: • Client (browser/mobile) sends a request • API acts as a middle layer and forwards the request • Django backend processes the request using models • Data is fetched from the database • API converts the data into JSON format • JSON response is sent back to the client This helped me understand how APIs act as a bridge between frontend and backend in real-world applications. Sharing a simple visual (3D diagram) to explain the API flow in Django. #Django #RESTAPI #Python #BackendDevelopment #LearningJourney #WebDevelopment
To view or add a comment, sign in
-
-
One small Django feature that saved me a lot of time ⏱️ 👉 Django Admin Panel When I started building projects, I used to create custom pages for managing data… Then I discovered Django’s built-in admin panel 🤯 With just a few lines of code, I can: ✔ Add / update / delete data ✔ Manage users ✔ View database records instantly Example: from django.contrib import admin from .models import Product admin.site.register(Product) That’s it. Now I can manage my entire database from a UI 🚀 This feature makes Django super powerful for rapid development. What’s your favorite Django feature? 👇 #Django #Python #WebDevelopment #Backend #Learning
To view or add a comment, sign in
-
Explore related topics
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