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

  • SEARCH
  • Home
  • 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 6827467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:16:08+00:00 2026-05-26T22:16:08+00:00

Ok here is the problem in brief. I do have a pyramid setup that

  • 0

Ok here is the problem in brief. I do have a pyramid setup that does start to look like a cms.
I have as base models: [accounts, pages, errors, menus, configs]

It works pretty well but I do have a little problem with something. Currently i’m using git and on some branches I do have different templates and on the master branch I do my change to the core.

I’d like to be able to install themes instead. Themes would be a collection of template files/static file(css/js).

That can be achieved with entry_points and my config view can look them up and display a list of installed themes. That so far can be done.

Being able to switch different themes on the fly would be a very good start so I wouldn’t have to fork my projects only for new themes.

The second problem is that theses sites requires different content. For example, one would require “Question” and the other “Products”

So I have this idea in mind

class TemplatePlugin(PyramidPlugin):
    template_path = ''
    static_path = ''

    def register(self, config, app):
        '''Inject the plugin in the application... how I'm not sure yet'''

    def unregister(self):
        '''unregister the plugin if something is needed'''

    def (before/after)_(request/newapp...)(self,...):
        '''do some stuff for some events most are optional'''

And a different plugin for models

class PyramidPlugin(pyramid_plugin):
    def register(self, config, app):
         '''add routes,
            add view handlers (view_config)
            add models acl to the acl list
         '''

    # other functions similar to the above class to handle events

My biggest problem is how does it find files. I will have to do some test but i’m worried about translations, and file path.

How does it works through entries points is still a mistery to me. Will plugins use babel translations… can I use my babel translation in my template plugins? When an entry point is loaded..current dir is the dir of the project or the dir of the entry point? I believe I can easily get the path with distribution but I’m not sure what is the right way to do all this… I feel like i’m getting in a whole new land filled with mines.

  • 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-26T22:16:09+00:00Added an answer on May 26, 2026 at 10:16 pm

    In Pyramid you can pick templates at run-time using render_to_reponse function. But if you want a more cooked solution, you might get inspired by Kotti, a Pyramid CMS that already has support for addons and look and feel customization with ‘Babel’ for internationalization. In order to use another ‘theme’ you have to write another package with some templates and static assets following the convention Kotti uses and then you activate the package in the .ini configuration file.

    To understand how Kotti achieves this, you should start following the code path from this line

    In any case, Kotti makes some assumptions about how the Pyramid application is configured, such as SQLAlchemy for storage, formencode for form generation or traversal to map views to resources, so YMMV. Pyramid itself is unopinionated about the way you do this.

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

Sidebar

Related Questions

I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I have a problem here. My Zend_Forms do not render in view script. Via
I've got a problem here with an MSI deployment that I'm working on (using
Just a small SVN problem here. I setup my own SVN server Setting up
I have an interesting problem here I've been trying to solve for the last
I have one main thread that does some rather CPU intensive operation. The thread
Problem in brief I have got a piece of working two dimensional scrolling code.
I have been having a problem that has troubled me for a while. Searching
Here's the brief problem: Input: a list of strings, each containing numbers ( 3.4
I'm having a problem with QNetworkAccessManager. Here is some brief description of what I

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.