GSoC 2025 Proposal: Integrating django-template-partials into Django Core

Project Overview

Project Title

Bringing django-template-partials into Django Core Template System

Motivation

The django-template-partials library offers a powerful approach to creating reusable named inline partials in Django’s Template Language. By integrating this functionality into Django core, we aim to:

  • Standardize partial template handling
  • Enhance template modularity
  • Improve developer productivity
  • Provide native support for modern frontend techniques

Expected Outcomes

  1. Comprehensive implementation of template partials in Django core
  2. Seamless migration path for existing django-template-partials users
  3. Extensive documentation and test coverage
  4. Pull request for Django core integration

Potential Impact

  • Simplify template composition
  • Reduce template boilerplate
  • Establish a standard approach to template fragments
  • Support more dynamic frontend development

Detailed Project Plan

Project Timeline

  • February 27 - March 24, 2025: Initial research and community engagement
  • April 8, 2025: Proposal submission deadline
  • May 8 - June 1, 2025: Community bonding period
  • June 2 - August 25, 2025: Active development

Milestone Breakdown

Phase 1: Research and Preparation (Weeks 1-2)

  • Deep analysis of django-template-partials implementation
  • Review Django template system internals
  • Identify integration challenges
  • Consultation with Carlton Gibson and Django core developers

Phase 2: Core Implementation (Weeks 3-6)

  • Develop template partial tag implementation
  • Create template loader modifications
  • Implement context handling mechanisms
  • Add support for inline and named partials

Phase 3: Testing and Validation (Weeks 7-9)

  • Comprehensive test suite development
  • Diverse test scenario coverage
  • Test runner modifications
  • Performance and compatibility validation

Phase 4: Documentation and Migration (Weeks 10-12)

  • Migration guide for existing users
  • Detailed documentation preparation
  • Release notes creation
  • Django core pull request preparation

Potential Challenges

  • Maintaining backward compatibility
  • Performance optimization
  • Handling complex template inheritance
  • Minimizing disruption to existing template systems

Technical Approach

Implementation Strategy

  1. Extend Django’s template tag system
  2. Create a new template loader for partial handling
  3. Implement robust context preservation
  4. Add instrumented rendering for testing

Code Approach Example

Python

Collapse

1class PartialNode(template.Node):
2    def __init__(self, partial_name, nodelist):
3        self.partial_name = partial_name
4        self.nodelist = nodelist
5
6    def render(self, context):
7        # Render partial with current context
8        return self.nodelist.render(context)
9
10@register.tag('partialdef')
11def do_partial_definition(parser, token):
12    bits = token.split_contents()
13    partial_name = bits[1]
14    nodelist = parser.parse(('endpartialdef',))
15    parser.delete_first_token()
16    return PartialNode(partial_name, nodelist)

About the Contributor

Background

  • Computer Science Student at Modern Academy
  • CGPA: 3.6/4.0
  • Extensive experience in web development
  • Open-source contributor
  • Backend developer for Egypt Metro platform

Relevant Experience

  • Django backend development
  • Full-stack web development
  • Open-source project contributions
  • Internships at tech companies (Nokia, Orange Digital Center)

Open-Source Contributions

Technical Skills

  • Python, Django, Django REST Framework
  • PostgreSQL, Docker
  • Test-driven development
  • API design
  • Microservices architecture

Communication Plan

  • Weekly detailed progress reports
  • Regular mentor check-ins
  • Active Django Forum participation
  • Transparent development tracking
  • Responsive to feedback

Conclusion

This proposal aims to integrate django-template-partials into Django core, providing a standardized, flexible approach to template partials that enhances developer productivity.

2 Likes

Hi @AhmedNassar7 — welcome aboard.

I posted a note for GSoC prospects here:

1 Like

Hi @carltongibson,

I will further explore django-template-partials, analyze the codebase, and investigate relevant issues both in this repository and Django itself. I’ll also ensure my proposal reflects a deep understanding of DTL internals.

Project Exploration Progress:

  • Comprehensive review of django-template-partials codebase
  • Deep dive into Django Template Language (DTL) internals
  • Analyzing potential integration strategies and challenges

Clarification Requests:

  1. Are there specific repository issues you recommend exploring?
  2. What key technical aspects should I prioritize in my proposal?
  3. Any recommended resources for deeper DTL understanding?

I’m committed to creating a robust, user-friendly implementation that aligns with Django’s core principles. Looking forward to your guidance and insights.

@AhmedNassar7 I’ve edited your post to remove the contact data. It’s not wise to just post your personal details on an open forum. If you just ensure they’re in your proposal, that’s fine.

2 Likes

I understand not to share personal details in public. Should my GSoC proposal (including my contacts) be submitted as a PDF or directly through the GSoC platform? If a PDF is needed, how should I send it to you for review?

You submit through the GSoC platform and then that gets us access too.

1 Like

What is the best way to reach out to share progress updates, get feedback, and review my proposals? Are there specific best practices to follow?

Hi @AhmedNassar7 , You can create a draft proposal and share in a post in forum to gather feedback. It should be clear enough for others to understand the problem you are working on and the solution you are proposing . Timelines, milestones etc can be added in the final proposal as well.

Good Luck!

1 Like

Hi @DevilsAutumn,

Thanks for your response! I have already outlined the timeline and detailed each step of my project, covering the most critical aspects except for the implementation. If there are any specific details I should focus on, please let me know.

Since I’m still learning, I haven’t elaborated much on the coding part yet. I need step-by-step guidance to ensure I make steady progress, refine my approach, and align my proposal in the right direction. Instant feedback would be incredibly valuable in helping me improve and move forward efficiently.

I would appreciate your insights on any areas that need more detail or improvement. My main focus now is structuring the work efficiently and progressing towards a solid final proposal as soon as possible.

Thanks for your help and support.

1 Like

Dear @carltongibson and @DevilsAutumn,

I have made substantial progress on my proposal and have updated it with additional details, including:

  • Executive Summary
    • Project Vision
    • Mission Statement
    • Key Objectives
  • Problem Domain Analysis
    • Current Template Language Limitations
    • Quantitative Impact Assessment
  • Proposed Solution Architecture
    • Native Template Tag System
    • Intelligent Template Loader
    • Context Preservation Engine
    • Comprehensive Validation Framework
  • Detailed Technical Design
  • Technical Challenge Mitigation
    • Backward Compatibility
    • Performance Optimization
    • Complex Scenario Handling
  • Comprehensive Project Roadmap
    • Research & Preparation
    • Core Implementation
    • Validation & Testing
    • Documentation & Migration
  • Advanced Testing Strategy
  • Project Impact Vision
    • Transformative Outcomes
    • Long-term Benefits

You can review the updated proposal at the following link: Proposal Link.

I would greatly appreciate your feedback on the latest updates and any insights you may have. Looking forward to your thoughts!

@AhmedNassar7 I find the proposal deeply problematic. It looks LLM generated. Most of the bullet points make zero sense, and the phrasing borders on ridiculous.

…revolutionizing template modularity and developer productivity…

Seriously?

Challenges in modern frontend development.

This says nothing.

30% increase in template management complexity.

That’s just invented.

I could go on.

I strongly suggest that you start with a blank slate, drop the LLM, and write a sensible proposal yourself if you want any chance of being selected for GSoC.

(post deleted by author)

This is my first contribution to GSoC, and I’m eager to learn and improve. I’m unsure how to move forward. I have updated and changed the last proposal as requested and still working on it. I need some clarification:

I always strive to follow best practices that align with Django and want to ensure my work meets the expected standards.

1 Like

@AhmedNassar7, as of my understanding, it’s okay to use LLM to learn about something. But not to use LLM to generate some text and use it blindly. Because who has the responsibility to a given point in the generated text?. Instead, they want you to understand the problem, why we need to solve it, how should we solve it, and design/imagine some intuitive solution/process/procedure and propose it to the existing community.
Even though it’s advertised as LLM can code full applications and code better, it still lack intuitive understanding of the world and human needs.

Instead; first, understand the problem, write your own solutions, questions, code (why, how, when, what). Only use LLM for spelling corrections, understand complex documents etc. Still, we have to read the documentation(django), read the code, write the code manually. Thanks. No offence is intended. :+1:

This means to use an old GSoC proposal for reference.

2 Likes

Hi @everyone,
Before submitting my proposal, I would like to get some suggestions and feedbacks. As this is my first time taking part in GSoC and new experience in open source, And before submitting I am also going to add some Github links of my test coding.
here is my proposal.LINK

1 Like

Thanks for your feedback and advice. I’m taking this approach.

Hi @carltongibson

I have made a new draft proposal as requested and it is still under development. I need to ensure that I’m in the correct way and it’s make a sense. You can check it via this Link. If else, I will try to make a new one or as your request. Hoping to meet your expectations!
Also, I didn’t put the implementation now and will finalize it today, but firstly, I need to ensure the correct way before going deep. waiting for your response!

1 Like

Hi mentor @carltongibson,

I’ve been working on the final version of my proposal all these days. I tried to make all your requested feedback. I’ve shared it for your review via GitHub Gist. If there is anything else needed from me, let me know. I’ll be happy to work on it. I’ll appreciate any feedback before I submit it to the GSoC platform.

I really passionate, interested, and love Django very much. I have done all the following and still strive for more.

  • Contributed to Django open-source with 4 PRs (1 merged and 3 under-review)
  • Wokring on my Graduation Project Egypt Metro PLatform. I am responsible for the backend Django integrating with the frontend flutter and AI.
  • Get a web development using python scholarship from ITI, which enhanced my experience in django.
  • I’m working on others tickets in Django and will submit the new PRs soon.

I’ll be happy and hope to give me this great opportunity and chance. I believe that I’ll be a successful contributor and make an impactful project and contribution.

Thank you.