Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2186 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Quickstart with auth set to "no" creates a broken root controller

Reported by: brainsik Owned by: faide
Priority: highest Milestone: 2.0b6
Component: TurboGears Version: trunk
Severity: blocker Keywords: quickstart securecontroller 2.0b5
Cc: Gustavo

Description

The following was done in a freshly created virtualenv for TG2 beta5.

Create a new quickstart project without authentication and authorization:

$ paster quickstart
Enter project name: quickstart
Enter package name [quickstart]: 
Do you need authentication and authorization in this project? [yes] no

Start the server:

$ paster serve --reload development.ini
Starting subprocess with file monitor
Starting server in PID 61611.
serving on http://127.0.0.1:8080

Visit the URL, and you receive the following traceback:

URL: http://127.0.0.1:8080/
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/WebError-0.9.1-py2.5.egg/weberror/evalexception.py', line 428 in respond
  app_iter = self.application(environ, detect_start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/TurboGears2-2.0b5-py2.5.egg/tg/configuration.py', line 649 in wrapper
  return app(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/TurboGears2-2.0b5-py2.5.egg/tg/configuration.py', line 552 in remover
  return app(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/repoze.tm2-1.0a3-py2.5.egg/repoze/tm/__init__.py', line 19 in __call__
  result = self.application(environ, save_status_and_headers)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-py2.5.egg/tw/core/middleware.py', line 36 in __call__
  return self.wsgi_app(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-py2.5.egg/tw/core/middleware.py', line 59 in wsgi_app
  resp = req.get_response(self.application)
File 'build/bdist.macosx-10.5-i386/egg/webob/__init__.py', line 1337 in get_response
File 'build/bdist.macosx-10.5-i386/egg/webob/__init__.py', line 1305 in call_application
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-py2.5.egg/tw/core/resource_injector.py', line 67 in _injector
  resp = req.get_response(app)
File 'build/bdist.macosx-10.5-i386/egg/webob/__init__.py', line 1337 in get_response
File 'build/bdist.macosx-10.5-i386/egg/webob/__init__.py', line 1305 in call_application
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/middleware.py', line 81 in __call__
  return self.app(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/middleware.py', line 159 in __call__
  return self.wrap_app(environ, session_start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/Routes-1.10.2-py2.5.egg/routes/middleware.py', line 118 in __call__
  response = self.app(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/wsgiapp.py', line 116 in __call__
  controller = self.resolve(environ, start_response)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/wsgiapp.py', line 253 in resolve
  return self.find_controller(controller)
File '/Volumes/Users/brainsik/src/virt.tg2b5/lib/python2.5/site-packages/TurboGears2-2.0b5-py2.5.egg/tg/wsgiapp.py', line 38 in find_controller
  __import__(full_module_name)
File '/Volumes/Users/brainsik/src/tg2/b5/quickstart/quickstart/controllers/root.py', line 9 in <module>
  class RootController(BaseController):
File '/Volumes/Users/brainsik/src/tg2/b5/quickstart/quickstart/controllers/root.py', line 10 in RootController
  secc = SecureController()
NameError: name 'SecureController' is not defined

The contents of controllers/root.py is:

"""Main Controller"""
from quickstart.lib.base import BaseController
from tg import expose, flash, require, url, request, redirect
from pylons.i18n import ugettext as _
#from tg import redirect, validate
from quickstart.model import DBSession, metadata
from quickstart.controllers.error import ErrorController

class RootController(BaseController):
    secc = SecureController()
    error = ErrorController()

    @expose('quickstart.templates.index')
    def index(self):
        return dict(page='index')

    @expose('quickstart.templates.about')
    def about(self):
        return dict(page='about')

This was confirmed by gustavonarea on irc.freenode.net in #turbogears.

Change History

comment:1 Changed 10 years ago by Gustavo

  • Cc Gustavo added
  • Priority changed from normal to highest
  • Severity changed from normal to blocker

I've taken a look into this and I have no idea how it broke nor how to fix it. I've not dealt with that stuff since v1.9.7 (I think) and it always worked.

comment:2 Changed 10 years ago by percious

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.