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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:33:51+00:00 2026-05-26T09:33:51+00:00

I am attempting to use url_for inside of a mako template with pyramid (using

  • 0

I am attempting to use url_for inside of a mako template with pyramid (using a book example):

${h.url_for(controller='formtest',action='submit')}

When I do, I get this error:

AttributeError: 'thread._local' object has no attribute 'mapper' 

I installed routes and put this in my helpers.py file:

import webhelpers.html.tags as tags
from routes import url_for

Googling the error, I read that url_for has been deprecated for Pylons. Is this true for Pyramid too? If so, what should I be using?

  • 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-26T09:33:51+00:00Added an answer on May 26, 2026 at 9:33 am

    Are you sure you’re using Pyramid? Every thing that you have posted is about Pylons and not Pyramid. They are very different frameworks.

    Assuming you are using Pylons, url_for was deprecated. You should instead be using the url global variable which is imported from from pylons import url.

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

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I am attempting to use the following code to search a database using words
I am attempting to use ASIHttpRequest with the iPhone to get some information from
Using the resource routes, you can do things like url_for(@apple) to get a url
I'm attempting to use Fogbugz's BugzScout in order to automatically submit unhanded application exceptions
Using Ruby 1.9.2 and Rails 3 - When attempting to use <%= error_messages_for 'story'
I am attempting to use the jQuery Frame Animation plugin and cannot get it
I am attempting to find out which URL a URI redirects to with use
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
When attempting to use HttpWebRequest to retrieve a page from my dev server, 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.