Not able to login into pyf(TypeError: url() got an unexpected keyword argument 'came_from' when clicking on login button)

185 views
Skip to first unread message

Anoop

unread,
Oct 16, 2012, 3:32:17 PM10/16/12
to pyf-...@googlegroups.com
Hi,

   I am new to pyf, I installed pyf using virtualenv in my ubuntu 12.04 box with python 2.7

easy_install -UZ pyf.services
easy_install -UZ pyf[components]

and I configuraed pyf as mentioned here http://pyfproject.org/en/getting-started/configuring using postgresql9.1

and paster serve pyfservices.ini created the table structure and populated necessory data like tg_user.

paster serve pyfservices.ini also running without errors

 paster serve pyfservices.ini
00:41:31,632 INFO  [tgscheduler.scheduler] Starting the scheduler...
00:41:31,672 INFO  [root] Scheduling tasks
00:41:31,749 INFO  [root] Finished scheduling tasks
00:41:31,763 INFO  [turbomail.control] TurboMail extension starting up.
00:41:31,764 INFO  [turbomail.manager] Immediate manager starting up.
00:41:31,764 INFO  [turbomail.manager] Immediate manager ready.
Starting server in PID 3605.
serving on http://127.0.0.1:8080


when I am accessing url in browser login button is visible

when I am clicking on login I am getting TypeError: url() got an unexpected keyword argument 'came_from'

 template_name=template_name, **render_params)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/TurboGears2-2.2.0-py2.7.egg/tg/render.py', line 183 in render
  kwargs['result'] = render_function(template_name, tg_vars, **kwargs)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/TurboGears2-2.2.0-py2.7.egg/tg/render.py', line 404 in __call__
  ns_options=('doctype', 'method'), **kwargs)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/TurboGears2-2.2.0-py2.7.egg/tg/render.py', line 248 in cached_template
  return render_func()
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/TurboGears2-2.2.0-py2.7.egg/tg/render.py', line 401 in render_template
  doctype=doctype, method=method, encoding=None))
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/core.py', line 183 in render
  return encode(generator, method=method, encoding=encoding, out=out)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 57 in encode
  return _encode(''.join(list(iterator)))
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 470 in __call__
  for kind, data, _ in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 826 in __call__
  for kind, data, pos in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 670 in __call__
  for kind, data, pos in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 771 in __call__
  for kind, data, pos in chain(stream, [(None, None, None)]):
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/output.py', line 586 in __call__
  for ev in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/core.py', line 288 in _ensure
  for event in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/base.py', line 605 in _include
  for event in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/markup.py', line 362 in _match
  content = list(content)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/base.py', line 605 in _include
  for event in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/markup.py', line 327 in _match
  for event in stream:
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/markup.py', line 316 in _strip
  event = next()
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/base.py', line 555 in _flatten
  for event in self._flatten(value, ctxt, **vars)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/base.py', line 565 in _flatten
  result = _eval_expr(data, ctxt, vars)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/base.py', line 277 in _eval_expr
  retval = expr.evaluate(ctxt)
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/Genshi-0.6-py2.7.egg/genshi/template/eval.py', line 178 in evaluate
  return eval(self.code, _globals, {'__data__': data})
File '/home/anoop/usr/pyfenv/lib/python2.7/site-packages/pyf.services-2.0.2-py2.7.egg/pyf/services/templates/login.html', line 16 in <Expression u"tg.url('/login_handler', came_from = came_from.encode('utf-8'), __logins = login_counter.encode('utf-8'))">
  <form action="${tg.url('/login_handler', came_from = came_from.encode('utf-8'), __logins = login_counter.encode('utf-8'))}" method="POST" class="loginfields">
TypeError: url() got an unexpected keyword argument 'came_from'






CGI Variables
-------------
  CONTENT_LENGTH: '0'
  CONTENT_TYPE: '; charset=utf-8'
  HTTP_ACCEPT: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
  HTTP_ACCEPT_ENCODING: 'gzip, deflate'
  HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5'
  HTTP_CONNECTION: 'keep-alive'
  HTTP_HOST: 'localhost:8080'
  HTTP_REFERER: 'http://localhost:8080/login'
  HTTP_USER_AGENT: 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:11.0) Gecko/20100101 Firefox/11.0'
  PATH_INFO: '/login'
  REMOTE_ADDR: '127.0.0.1'
  REQUEST_METHOD: 'GET'
  SERVER_NAME: '127.0.0.1'
  SERVER_PORT: '8080'
  SERVER_PROTOCOL: 'HTTP/1.1'


WSGI Variables
--------------
  application: <function remover at 0x9a1f224>
  beaker.cache: <beaker.cache.CacheManager object at 0x99efa4c>
  beaker.get_session: <bound method SessionMiddleware._get_session of <beaker.middleware.SessionMiddleware object at 0x99ef86c>>
  beaker.session: {'_accessed_time': 1350414784.802194, '_creation_time': 1350414784.802194}
  paste.cookies: (<SimpleCookie: >, '')
  paste.httpserver.thread_pool: <paste.httpserver.ThreadPool object at 0x8dc18cc>
  paste.registry: <paste.registry.Registry object at 0xa038acc>
  paste.throw_errors: True
  pylons.action_method: <bound method RootController.routes_placeholder of <pyf.services.controllers.root.RootController object at 0xa03caec>>
  pylons.controller: <pyf.services.controllers.root.RootController object at 0xa03caec>
  pylons.environ_config: {'session': 'beaker.session', 'cache': 'beaker.cache'}
  pylons.pylons: <pylons.util.PylonsContext object at 0xa03c6ac>
  pylons.routes_dict: {'url': u'/login', 'action': u'routes_placeholder', 'controller': u'root'}
  repoze.tm.active: True
  repoze.who.logger: <logging.Logger object at 0x8d323ec>
  repoze.who.logins: 0
  repoze.who.plugins: {'form': <FriendlyFormPlugin 161561676>, 'main_identifier': <FriendlyFormPlugin 161561676>, 'authorization_md': <repoze.what.middleware.AuthorizationMetadata object at 0x9a13d0c>, 'cookie': <AuthTktCookiePlugin 161561644>, 'sqlauth': <repoze.who.plugins.sa.SQLAlchemyAuthenticatorPlugin object at 0x9a13bec>, 'sql_user_md': <repoze.who.plugins.sa.SQLAlchemyUserMDPlugin object at 0x9a13ccc>}
  routes.route: <routes.route.Route object at 0x98bc8ec>
  routes.url: <routes.util.URLGenerator object at 0xa03c3cc>
  toscawidgets.framework: <tw.mods.base.HostFramework object at 0x99efaac>
  toscawidgets.javascript.require_once: False
  toscawidgets.prefix: '/toscawidgets'
  webob._parsed_query_vars: (GET([]), '')
  webob.adhoc_attrs: {'controller_state': <crank.dispatchstate.DispatchState object at 0xafa1f14c>, 'language': 'en-us', 'start_response': <function repl_start_response at 0xa035c34>, 'response_type': None, 'response_ext': None, 'identity': None}
  wsgi process: 'Multithreaded'
  wsgiorg.routing_args: (<routes.util.URLGenerator object at 0xa03c3cc>, {'url': u'/login', 'action': u'routes_placeholder', 'controller': u'root'})


------------------------------------------------------------




thanks,

  Anoop

Reply all
Reply to author
Forward
0 new messages