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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:14:22+00:00 2026-06-05T04:14:22+00:00

I would like to use the class based views that pystache offers in my

  • 0

I would like to use the class based views that pystache offers in my pyramid application, but I’m not entirely sure how to integrate the two properly. I’ve read this already, but it doesn’t talk about using the class based views.

How would I create a new renderer for pystache if I wanted to use class based views? Can somebody help me out here?

Also, while I already know how mustache works, I can’t seem to find much information on the python implementation (pystache). Can somebody point me in the right direction here?

  • 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-05T04:14:25+00:00Added an answer on June 5, 2026 at 4:14 am

    Implement a MustacheRendererFactory:

    class MustacheRendererFactory(object):
      def __init__(self, info):
        self.info = info
    
      def __call__(self, value, system):
        package, filename = resolve_asset_spec(self.info.name)
        template = os.path.join(package_path(self.info.package), filename)
        template_fh = open(template)
        template_stream = template_fh.read()
        template_fh.close()
        return pystache.render(template_stream, value)
    

    Update your configurator setup, probably in __init__.py:

    def main(global_config, **settings):
      config = Configurator(settings=settings)
      # ...
      # Use Mustache renderer
      config.add_renderer(name='.mustache',
        factory='myapp.mustacherenderer.MustacheRendererFactory')
      # ...
    

    Use in your views:

    @view_config(route_name='myview', renderer='myapp:templates/notes.mustache')
    def my_view(request):
      # ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that I would like to use in a scala.collection.mutable.PriorityQueue, but
I would like to use the .navbar-search class in Boostrap, but I would like
I would like to use different instances of an STL custom allocator class to
I'm using the CCNode class in cocos2d and would like to use its schedule:interval:
I would like to ask couple of Questions regarding the use of Monitor Class
For class, I would like a to use PHP MVC framework very similar to
I have a class which is intended for immutable use, hence I would like
I would like to use the group_by method, but instead of using a column
I would like to use complex numbers as defined in C99, but I need
I would like to wrap a non-Traits model class for use with Python Traits.

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.