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
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:
>
>
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.
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