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

The Archive Base Latest Questions

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

I am still learning pyramid, and I am at a point where I am

  • 0

I am still learning pyramid, and I am at a point where I am trying to learn how to use decorators. Below is a copy of my test view callable.

from pyramid.response import Response
from pyramid.view import view_config
from pyramid.renderers import render_to_response

def my_blog(request):
    return {'project':'tricky'}

@view_config( renderer='templates/foo.pt' )
def foo_blog(request):
    return {'name':'tricky'}

From what I can understand about the view_config decorator, it can be used to set application configurations without actually setting them in the config file. In the case of this example, I am setting the renderer to be templates/foo.pt. This does not ever work.

However, if I set renderer in the config file (init.py) as such:

config.add_route( 'foo_blog' , '/blog/{foo}' ,  view='tricky.views.Blog.blog.foo_blog' renderer='tricky:templates/mytemplate.pt' )

it will work.

Am I doing something wrong that is preventing me from being able to use the decorator. Thanks!

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

    In order for the configurations added via @view_config to work, you need to call config.scan() at some point.

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

Sidebar

Related Questions

I'm still learning Java. I'm trying to get use SharedPreferences to set the url
I'm still learning js and trying out the Webstorm IDE, which seems sweet (including
Hi so I'm still learning to use methods, but one of my assignments requires
I'm still learning C and I must have misunderstood pointers at some point. I
I'm still learning the dark arts of TDD and recently I've been trying to
I'm still learning about REST and, in my test, came up with this scenario
Still learning the MySQL ropes and I'm trying to find out how to do
I'm still learning what hibernate can do and this time i'm trying something that
Still learning clojure and doing an experiment on trying to wrap my head around
I am still learning Perl scripting and need help in doing below task. Sample

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.