That's fine, my point is that it should read:

config = Configurator(settings=settings)
config.include('pyramid_beaker')

The effect is the same, but you are doing extra work using your setup,
which you'd only want to do if you had some special way of setting up that
session.

On Thu, Dec 8, 2011 at 3:32 AM, Dick Kniep <dickkn...@gmail.com> wrote:

> Hi Michael,
>
> Thanks a lot. It works, however, I only removed
>
> config.set_session_factory(session_factory)
>
> so, now it reads:
>
>    session_factory = session_factory_from_settings(settings)
>    config = Configurator(settings = settings, session_factory =
> session_factory)
>    config.include('pyramid_beaker')
>
> But can I use beaker now?
> (As you will have guessed by now, I am a newbe on pyramid.....)
>
> On 7 dec, 22:13, Michael Merickel <mmeri...@gmail.com> wrote:
> > You are settings the session factory 3 times.
> >
> > The two calls that actually conflict are:
> >
> > config = Configurator(settings = settings, session_factory =
> > session_factory)
> >
> > and
> >
> > config.set_session_factory(session_factory)
> >
> > However, note that config.include('pyramid_beaker') also sets the session
> > factory from the settings. Since you set the session factory in your own
> > code though, that one gets overridden (it's not actually causing the
> error
> > you're seeing).
> >
> > Recommended solution:
> >
> > Only call config.include('pyramid_beaker') and get rid of the other 2
> calls.
> >
> >
> >
> >
> >
> >
> >
> > On Wed, Dec 7, 2011 at 10:37 AM, Dick Kniep <dickkn...@gmail.com> wrote:
> > > Hi list,
> >
> > > Currently we are building a very interesting new webapp based on
> > > pyramid and jquery-mobile. I am trying to include beaker in the app,
> > > but I get a traceback mentioning a conflicting configuration. The
> > > following traceback appears.
> >
> > > Traceback (most recent call last):
> > >  File "/home/dick/workspace/cvix-portal-nieuw/trunk/src/
> > > cvixmobile.py", line 243, in <module>
> > >    app = config.make_wsgi_app()
> > >  File "/home/dick/pyramid/lib/python2.6/site-packages/pyramid-1.2.3-
> > > py2.6.egg/pyramid/config/__init__.py", line 796, in make_wsgi_app
> > >    self.commit()
> > >  File "/home/dick/pyramid/lib/python2.6/site-packages/pyramid-1.2.3-
> > > py2.6.egg/pyramid/config/__init__.py", line 485, in commit
> > >    self.action_state.execute_actions()
> > >  File "/home/dick/pyramid/lib/python2.6/site-packages/pyramid-1.2.3-
> > > py2.6.egg/pyramid/config/__init__.py", line 900, in execute_actions
> > >    for action in resolveConflicts(self.actions):
> > >  File "/home/dick/pyramid/lib/python2.6/site-packages/pyramid-1.2.3-
> > > py2.6.egg/pyramid/config/__init__.py", line 1014, in resolveConflicts
> > >    raise ConfigurationConflictError(conflicts)
> > > pyramid.exceptions.ConfigurationConflictError: Conflicting
> > > configuration actions
> > >  For: <InterfaceClass pyramid.interfaces.ISessionFactory>
> > >    ('/home/dick/pyramid/lib/python2.6/site-packages/pyramid-1.2.3-
> > > py2.6.egg/pyramid/config/__init__.py', 360, 'setup_registry',
> > > 'self.set_session_factory(session_factory)')
> > >    ('/home/dick/workspace/cvix-portal-nieuw/trunk/src/cvixmobile.py',
> > > 222, '<module>', 'config.set_session_factory(session_factory)')
> >
> > > The code that is generating this is:
> >
> > > if __name__ == '__main__':
> > >    # configuration settings
> > >    from app_config import settings
> > >    log = services.Logging.defineLogger(log)
> > >    # session factory
> > >    session_factory = session_factory_from_settings(settings)
> > >    config = Configurator(settings = settings, session_factory =
> > > session_factory)
> > >    config.include('pyramid_beaker')
> > >    config.set_session_factory(session_factory)
> > >    config.add_route('clienten', '/clienten')
> > >    # static view setup
> > >    config.add_static_view('static', os.path.join(here, 'static'))
> > >    # scan for @view_config and @subscriber decorators
> > >    config.scan()
> > >    # serve app
> > >    app = config.make_wsgi_app()
> > >    serve(app, host='0.0.0.0',port=8082)
> >
> > > Could anyone point me in the right direction?
> >
> > > Thanks in advance,
> > > D.Kniep
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "pylons-discuss" group.
> > > To post to this group, send email to pylons-discuss@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > pylons-discuss+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/pylons-discuss?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To unsubscribe from this group, send email to
> pylons-discuss+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to