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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:47:50+00:00 2026-05-13T23:47:50+00:00

I’m a python newbie and starting out with using the Bottle web framework on

  • 0

I’m a python newbie and starting out with using the Bottle web framework on Google App Engine. I’ve been messing with the super small, super easy Hello World sample and have already ran into problems. Heh. I finally got the code to work with this…

import bottle
from bottle import route
from google.appengine.ext.webapp import util 

@route('/')
def index():
    return "Hello World!"

util.run_wsgi_app(bottle.default_app())

My question is, I thought I could just go ‘import bottle’ without the second line. But if I take the second line out, I get a NameError. Or if I do ‘from bottle import *’, I still get the error. bottle is just a single file called ‘bottle.py’ in my site’s root directory. So neither of these work….

import bottle
from google.appengine.ext.webapp import util 

@route('/')
def index():
    return "Hello World!"

util.run_wsgi_app(bottle.default_app())

Or

from bottle import *
from google.appengine.ext.webapp import util 

@route('/')
def index():
    return "Hello World!"

util.run_wsgi_app(bottle.default_app())

The error message I get is…

Traceback (most recent call last):
File
“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 3180, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File
“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 3123, in _Dispatch
base_env_dict=env_dict) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 515, in Dispatch
base_env_dict=base_env_dict) File
“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 2382, in Dispatch
self._module_dict) File “/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 2292, in ExecuteCGI
reset_modules = exec_script(handler_path, cgi_path,
hook) File
“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py”,
line 2188, in ExecuteOrImportScript
exec module_code in script_module.dict File
“/Users/tyler/Dropbox/sites/dietgrid/code2.py”,
line 4, in
@route(‘/’) NameError: name ‘route’ is not defined

So am I wrong in thinking it should be able to work the other ways or no?

  • 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-13T23:47:51+00:00Added an answer on May 13, 2026 at 11:47 pm

    In your code you have two different ways of calling methods from bottle package.

    route('/hello')
    

    and

    bottle.default_app()
    

    First call requires from bottle import route or from bottle import * and second one requires import bottle.

    from foo import bar is letting you to use method or parameter bar in your code without specifying the package on each call.

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

Sidebar

Ask A Question

Stats

  • Questions 374k
  • Answers 374k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think the BTST instruction will be of use to… May 14, 2026 at 7:58 pm
  • Editorial Team
    Editorial Team added an answer The line foo = options[:foo] || true with options[:foo] being… May 14, 2026 at 7:58 pm
  • Editorial Team
    Editorial Team added an answer It's a bug. May 14, 2026 at 7:58 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.