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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:49:51+00:00 2026-05-16T08:49:51+00:00

I started playing around with web2py the other day for a new project. I

  • 0

I started playing around with web2py the other day for a new project. I really like the structure and the whole concept which feels like a breath of fresh air after spending a few years with PHP frameworks.

The only thing (currently) that is bothering me is the ticketing system. Each time I make a misstake a page with a link to a ticket is presented. I guess I could live with that if the link worked. It currently points to an admin page with http as protocol instead of https. I’ve done a bit of reading and the forced https for admin seems to be a security measure, but this makes debugging a pain.

Whats the standard solution here? Alter the error page, allow http for admin och use logs for debugging?

Best regards
Fredrik

  • 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-16T08:49:52+00:00Added an answer on May 16, 2026 at 8:49 am

    I was in the same boat as you, I did not like the default mechanism. Luckily, customized exception handling with web2py is very straightforward. Take a look at routes.py in the root of your web2py directory. I’ve added the following to mine:

    routes_onerror = [(‘application_name/*’,’/application_name/error/index’)]

    This routes any exceptions to my error handler controller (application_name/controllers/error.py) in which I defined my def index as:

    def index():
        if request.vars.code == '400':
            return(dict(app=request.application,
                ticket=None,
                traceback="A 400 error was raised, this is controller/method path not found",
                code=None,
                layer=None,
                wasEmailed=False))
        elif request.vars.code == '404':
            return(dict(app=request.application,
                ticket=None,
                traceback="A 404 error was raised, this is bad.",
                code=None,
                layer=None,
                wasEmailed=False))  
        else:
            fH = file('applications/%s/errors/%s' % (request.application,request.vars.ticket.split("/")[1]))
            e = cPickle.load(fH)
                fH.close()
                __sendEmail(request.application,e['layer'],e['traceback'],e['code'])
            return(dict(app=request.application,
                ticket=request.vars.ticket,
                traceback=e['traceback'],
                code=e['code'],
                layer=e['layer'],
                wasEmailed=True))
    

    As you can see for non-400 and 404 errors, I’m emailing the traceback to myself and then invoking the corresponding views/error/index.html. In production, this view gives a generic “I’m sorry an error has occurred, developers have been emailed”. On my development server, it displays the formatted traceback.

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

Sidebar

Related Questions

Started playing around with jQuery and the jsTree plugin yesterday, and have it successfully
I am playing around with Dave DeLong's excellent CHCSVParser for Objective-C with an extremely
I am a newbie to Android and playing around with the UI and SQLLite
I've recently started playing with Scala (2.8) and noticed the I can write the
I've started playing with Lucene.NET today and I wrote a simple test method to
I've started playing with Dojo a bit and I'm curious about variable scope issue
Alright, I'm having trouble getting started on this one. I'm trying to use the
I have seen samples for Mercurial ignore files for Visual Studio , amongst others.
Occasionally I am looking at some code, I search for usages of a method

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.