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 8055697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:28:23+00:00 2026-06-05T08:28:23+00:00

I want to add multiple jinja2 etensions but I don’t know the syntax. This

  • 0

I want to add multiple jinja2 etensions but I don’t know the syntax. This is my current config:

config = {  'webapp2_extras.sessions': {
    'cookie_name': '_simpleauth_sess',
    'secret_key': SESSION_KEY
  },
  'webapp2_extras.auth': {
    'user_attributes': []
  },'webapp2_extras.jinja2': {'template_path': 'templates',
          'filters': {'timesince': filters.timesince,
          'datetimeformat': filters.datetimeformat,
    'slugify_montao' : filters.slugify_montao,
'format_datetime_human' : filters.format_datetime_human,
'default_if_none' : filters.default_if_none,
'datetimeformat_viewad': filters.datetimeformat_viewad,
'datetimeformat_jinja': filters.datetimeformat_jinja,
},
          'environment_args': {'extensions': ['jinja2.ext.i18n']}},
          'webapp2_extras.sessions': {'secret_key': 'my-245-key'}}

I want to add the entension env = Environment(extensions=['jinja2htmlcompress.SelectiveHTMLCompress']) but I don’t know how to have more than one. Can you show me?

Thank you

http://jinja.pocoo.org/docs/extensions/

Update

Seeing the answer below, I’ve edited my config object to this:

config = { ‘webapp2_extras.sessions’: {
‘cookie_name’: ‘_simpleauth_sess’,
‘secret_key’: SESSION_KEY }, ‘webapp2_extras.auth’: {
‘user_attributes’: [] },’webapp2_extras.jinja2′: {‘template_path’: ‘templates’,
‘filters’: {‘timesince’: filters.timesince,
‘datetimeformat’: filters.datetimeformat, ‘slugify_montao’ : filters.slugify_montao, ‘format_datetime_human’ :
filters.format_datetime_human, ‘default_if_none’ :
filters.default_if_none, ‘datetimeformat_viewad’:
filters.datetimeformat_viewad, ‘datetimeformat_jinja’:
filters.datetimeformat_jinja, },
‘environment_args’: {‘extensions’: [‘jinja2.ext.i18n’, ‘jinja2htmlcompress.SelectiveHTMLCompress’]}},
}

  • 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-06-05T08:28:25+00:00Added an answer on June 5, 2026 at 8:28 am

    Multiple extensions can be specified as additional elements of the original list.

    ...
    'environment_args': {'extensions': ['jinja2.ext.i18n', 
                                        'jinja2htmlcompress.SelectiveHTMLCompress']}
    ...
    

    I have to say, though, your config dictionary appears to be irregularly formatted.
    One problem in particular is that you appear to have two 'webapp2_extras.sessions' keys which will not work.

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

Sidebar

Related Questions

I don't think this is possible but here goes... I want to add method
I want to add multiple borders on a single image. Is this possible through
I want to add multiple classes to an html element I know the following
I want add multiple images in my own project like 7 images but in
I want to know if it is possible to add multiple handlers for the
in order to make things easier for users i want to add multiple keyword
I want to add a class to multiple span elements with common classname's based
I have multiple text boxes with a class name .paymentamount .i want to add
I want to show multiple detail section in my jasper report. How to add
I want add some methods. And this directive can't help me. var viewModel =

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.