Indiegogo is committed to accessibility. If you have difficulty using our site, please contact support@indiegogo.com for assistance or view our accessibility notice by clicking here

This campaign is closed

Multiple Template Engines for Django

Provide first-class support for third-party template engines in Django and native Jinja2 integration

You may also be interested in

Closed
Closed
Closed
Closed
Closed

Multiple Template Engines for Django

Multiple Template Engines for Django

Multiple Template Engines for Django

Multiple Template Engines for Django

Multiple Template Engines for Django

Provide first-class support for third-party template engines in Django and native Jinja2 integration

Provide first-class support for third-party template engines in Django and native Jinja2 integration

Provide first-class support for third-party template engines in Django and native Jinja2 integration

Provide first-class support for third-party template engines in Django and native Jinja2 integration

Aymeric Augustin
Aymeric Augustin
Aymeric Augustin
Aymeric Augustin
1 Campaign |
Paris, France
$8,703 USD $8,703 USD 150 backers
207% of $4,190 Fixed Goal Fixed Goal

Update - October 3rd: Funded in two days! Thanks everyone! You're a great community.

This secures the core of the project (steps 1 and 3). I'll start working on the DEP this week-end.

There's a stretch goal at €6000 for improving the architecture of Django templates (step 2). Let's see if we can reach it! :-)

The project

The Django Template Language has a long history of receiving criticism for its design and its performance. During the last few years, the idea of replacing it with Jinja2 has come up regularly.

While the two languages have superficially similar syntax, they're quite different. Forcing a transition upon the entire Django ecosystem isn't realistic.

I'm proposing to solve this problem in Django 1.8 by:

  • supporting some alternate template engines such as Jinja2 out of the box
  • keeping the Django Template Language as the default template engine
  • defining a stable API for integrating third-party template engines
  • supporting multiple template engines within the same Django project

This will provide a standardized way to use Jinja2 templates in Django projects and to ship Jinja2 templates with pluggable apps.

Furthermore this will pave the path to template-based form rendering.

I'm planning to split the project in three parts. Steps 1 and 3 are the core of the project. Step 2 isn't strictly required but it would allow for a more consistent implementation of step 3.

Each step should require about forty hours of work if everything goes well — which isn't the most likely outcome, but I'm prepared to take the time this project will require :-)

Step 1: write a Django Enhancement Proposal (DEP)

I'll start by researching the subject and designing the implementation. I've already performed preliminary analysis and sketched APIs in order to validate my ideas before starting this campaign. But I still have many decisions to make, details to check, and blanks to fill.

The output of this step will be a DEP that:

  • expands the rationale summarized above
  • arguments design decisions
  • outlines an implementation plan
  • provides guidelines for third-party template engines
  • answers frequently asked questions
  • analyzes the features of Django templates
  • surveys other Python template engines

I will discuss and improve the DEP until consensus is reached.

Step 2: refactor Django templates as a library (stretch goal)

Unlike other Python template engines, Django templates are configured with global settings. That makes them hard to test or use as a library outside a Django project. This issue is discussed in ticket #17093 and in a mailing-list thread. Unfortunately, Christopher Medrela's patch wasn't merged and it doesn't apply any more.

My project is a good opportunity to complete this refactoring. It will bring Django templates up to par with other engines, make future maintenance easier, and is expected to provide a more robust base for implementing the DEP.

I will tackle this step if the campaign raises at least 6000.

Step 3: implement the DEP

You know the drill: code, tests, docs ;-)

That's nothing fancy but good software takes time, especially under strong backward-compatibility requirements.

Communication

Throughout the project, I will post weekly or fortnightly updates on the django-developers mailing-list and on the project's website. In each message, I will:

  • describe what I've been doing
  • explain what problems I encountered, if any, and what solutions I chose
  • announce what I'm planning to do next
  • talk about open questions and ask for feedback

About me

I've been a Django core developer since 2011.

With more than 50 commits touching `django.template` or `django.templatetags`, I know Django's template engine very well.

I have contributed several large features to Django:

  • timezone-aware handling of datetimes (1.4)
  • support for Python 3 (1.5) with the help of other committers
  • overhaul of transaction management (1.6)
  • app-loading refactor (1.7)

I haven't started working on a feature for Django 1.8 yet. If this campaign succeeds, it will be Jinja2!

Why Indiegogo?

An interesting question — after all I've been doing a lot of work for free during the last four years.

For each of the features listed above, I had a strong motivation. I worked on timezones to prove I could join the core team. I worked on Python 3 because I couldn't stand Python 2 any more. I worked on transactions and app-loading because my professional projects had hit Django's limitations in these areas.

Django templates are a different case. I'm happy with them for simple projects. They work quite well considering how they're designed and implemented. If I need something else, I know what my options are.

I'd like to improve Django in this area because I'm hearing demand from the community. However I'm not ready to dedicate so much of my free time without compensation for my family. Your gifts will allow me to give this project the attention it deserves and motivate me to produce the very best work I can manage.

If the campaign raises more than €8000 (which both the Migrations and PostgreSQL campaigns did) I will give back 20% of the proceeds above this limit to the Django Software Foundation and 5% to the Ada Initiative.

This campaign is my own. It isn't an official Django one. However, both the Django Software Foundation and the Django core team have given their approval.

Risks

Even the most carefully planned software project carries some risks. Unexpected edge cases can appear. Seemingly good design can be hard to implement cleanly.

However, considering my past experience with projects of similar size, I'm confident that I can resolve or sidestep such issues. Here are two examples:

  • When I started working on transactions, I didn't realize that my plan would add savepoints around every ORM operation, throwing off `assertNumQueries` in tests. After a long debate, I solved the problem by adding a keyword argument to the `atomic` context manager.
  • Near the end of my implementation of time zone support, I discovered two problems in the admin, one with date hierarchies, the other and datetime widgets. Since I wasn't able to fix them, I documented them as known limitations in Django 1.4. Eventually they were fixed in Django 1.6.

There's also a small risk that the Django core team or technical board will object to my design or my implementation. However, I have already obtained positive feedback on the general design from several core developers and most members of the technical board. I have also committed more backwards-incompatible and more complicated changes to Django before.

How to help

If you like this project, even if you can't contribute directly, there are many ways you can help!

  • Subscribe to the django-developers mailing list and participate in design discussions
  • Try the new features, once they make it into Django's developement version
  • Write a backend for your favorite template engine and validate the APIs
  • Right now, talk about the project! I'm not very good at this whole social media thing :-)

Thank you!

Looking for more information? Check the project FAQ
Need more information
Let us know if you think this campaign contains prohibited content.

Choose your Perk

Thanks!

Currency Conversion $10 USD
€10 EUR
Thanks for supporting the project!
51 claimed

Double thanks!

Currency Conversion $21 USD
€20 EUR
Thanks for making open-source development sustainable!
28 claimed

Bronze sponsor

Currency Conversion $52 USD
€50 EUR
All my gratitude. Credit as a supporter on the project's web page.
30 claimed

Silver sponsor

Currency Conversion $105 USD
€100 EUR
Twice as much gratitude. Add your logo and a link to your website in the credits.
15 claimed

Gold sponsor

Currency Conversion $262 USD
€250 EUR
In addition to the above, tell the world why you or your company supports this project in the credits.
6 claimed

Platinum sponsor

Currency Conversion $524 USD
€500 EUR
Like the gold sponsor, plus four months of email support for questions related to the project, starting with the 1.8 release or earlier, at your convenience.
1 out of 5 of claimed

Diamond sponsor

Currency Conversion $1,047 USD
€1,000 EUR
Like the gold sponsor, plus six months of email and phone support for questions related to the project, starting with the 1.8 release or earlier, at your convenience.
2 out of 3 of claimed

You may also be interested in

Up Caret