Re: [pylons-discuss] Problem between Pyramid's CSRF protection and Deform

2021-05-12 Thread 'Jonathan Vanasco' via pylons-discuss
They're not the same at all. The difference is on purpose. Janzert is correct, though his description may not necessarily be clear. The following might make more sense: The two functions do the following: pyramid.csrf.get_csrf_token(request) discern active ICSRFStoragePolicy invoke

Re: [pylons-discuss] how does pyramid know what "create" , "view", "edit" etc is ?

2021-05-12 Thread 'Jonathan Vanasco' via pylons-discuss
Extending and hoping to clarify Steve's example above, Pyramid users typically leverage the "predicates" to handle this mapping. by using the `request_method` predicate to map "GET" to "view", "POST" to "create", etc. On Monday, May 10, 2021 at 4:27:09 PM UTC-4 grc...@gmail.com wrote: > >

Re: [pylons-discuss] Use route_url just after the routes are added and without request

2021-05-12 Thread Michael Merickel
At that config-time in the application there is no active request and no server running. In Pyramid, all url-generation APIs rely on creating a url "relative to the wsgi environ" or "relative to the current request". This keeps the app itself easy to mount into complex existing url hierarchies.

[pylons-discuss] Use route_url just after the routes are added and without request

2021-05-12 Thread QLands Software
I have a Pyramid application that adds routes using: config.add_route("home", "/") config.add_view( homeView, route_name="home", "home.jinja2", ) The application uses PCA https://github.com/PyUtilib/pyutilib therefore