Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5993055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:37:14+00:00 2026-05-22T23:37:14+00:00

I want using a different templating language with Django. It’s actually HamlPy , which

  • 0

I want using a different templating language with Django. It’s actually HamlPy, which is a HAML-inspired language, that directly translates to Django templates.
Thus, I can do something like

from hamlpy import Compiler
compiler = Compiler()
django_template_string = compiler.process(hamlpy_template_string)

Please notice, it doesn’t need any context – it’s just template text preprocessing. The resultant text can than be used as a Django template in a normal way.

So, I want to wrap this code inside some deus-ex-machina code that will gracefully intervent template loading and preprocess it before Django tries to render or even parse it.

From what I see, if I could overload the Parser class and do

def parse(str):
    str = preprocess(str)
    super().parse(str)

it would be the most transparent solution.

I know about custom tags and filters. I realize that my task can be solved with the “global” `preprocess_hamlpy’ tag.

But I wonder if it can be done in a different way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:37:15+00:00Added an answer on May 22, 2026 at 11:37 pm

    Write a template loader and put it in your settings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Python I want to be able to draw text at different angles using
I'm using Autofac. I want to inject a different implementation of a dependency based
I want using GPS data (I got it from $GPRMC) in an desktop application(that
I want to start using Python for small projects but the fact that a
I want to start using .NET 3.5 features in an app that is currently
I want to start using Bing for a project which will include working out
I want to toggle my content using different links. If the contents of div2
I'm using Jade as templating engine for an app on node.js/express. I don't want
I am using different images and i want to include change color option. But
i have 3 navigation controller and i want to change each background using different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.