Here are the available events in Pyramid.
http://docs.pylonsproject.org/projects/pyramid/en/latest/api/events.html#pyramid.events.ApplicationCreated
On Tue, Jan 28, 2014 at 1:30 PM, Gael Pasgrimaud wrote:
> On Tue, Jan 28, 2014 at 04:25:14AM -0800, Jeryn Mathew wrote:
>> Hello all,
>>
>> I have
https://github.com/plone/plone.session/blob/master/plone/session/tktauth.py
Have you been able to use your patch with Apache's mod_auth_tkt?
On Sunday, September 23, 2012 12:03:43 PM UTC-4, Domen Kožar wrote:
>
> Created pull request, changed the approach a bit:
> https://github.com/Pylons/pyra
On Fri, Sep 21, 2012 at 1:54 PM, Domen Kožar wrote:
> For generating secrets it's important to discourage usage of random module,
> but use something like:
>
> secret = ''.join('%02x' % ord(x) for x in os.urandom(128))
Great wordpress site! Secrets transmitted in the clear without mandatory S
Clearly in that case you are on your own.
On Sep 17, 2012 12:57 PM, "Michael Merickel" wrote:
> In an effort to maintain compliance with the auth_tkt standard versus
> flexibility I would've rather seen this just accept the strings "md5",
> "sha256", etc rather than an arbitrary callable that may
On Friday, September 14, 2012 6:06:15 PM UTC-4, Chris McDonough wrote:
>
> On 09/14/2012 03:37 PM, Florian R�chel wrote:
> > Hi Domen,
> >
> > I would agree with you if it would really complicate things much, but I
> > can't see why it would. All those cases are really simple to implement
>
I dislike md5 as much as the next guy, but auth_tkt uses a double hashing
scheme that is almost hmac. Hmac overcomes most of the problems of an
otherwise weak hash function. It isn't as bad as you might think.
The sha2 functions are a great replacement. Sha2 auth_tkt is what I would
use. Sha1 is d
translationstring installs these files, and it has no dependencies on
Plone or any other package outside the standand library.
cat translationstring-1.1-py2.7.egg-info/installed-files.txt
../translationstring/__init__.py
../translationstring/compat.py
../translationstring/tests/__init__.py
../tran
IIRC repoze.who doesn't do anything without plugins. It should be safe to
assume the ldap plugin will work fine with pyramid_who.
It's usually simpler to do authentication in the pyramid application, not in
middleware, but if you want to use repoze.who as a middleware then
pyramid_who will reco
'return' makes sense because views return a response. Whether the response
has an error code of 200, 301 or 5xx is a separate concern. Of course
exceptions make sense too.
In Pyramid you could replace the standard context finding methods with a
view that raises exceptions and build your whole a
You don't log requests already? Here is one:
http://pythonpaste.org/modules/translogger.html
Perhaps the format could just log the path without having to do any text
processing on the file.
I thought your original question was more like 'print out all the routes'
without making requests to the ap
The specific check is in view.py:is_response
if ( hasattr(ob, 'app_iter') and hasattr(ob, 'headerlist') and
hasattr(ob, 'status') ):
return True
return False
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to th
The web application format would be the equivalent of a .war file in the
Java world, or whatever you have to provide for Google App Engine: a
collection of your application code and static configuration that could be
easily deployed on a compliant web server. For example you might be able to
expres
IIRC Pyramid doesn't really depend on Paste in any important way. You could
just try to get it working under CherryPy, uWSGI or wsgiref for example, and
get the configuration dictionary some other way besides having Paste parse
.ini into {}.
I hope Ian's Web Application Format proposal gets spe
In other words you can probably get most of the same events by subclassing
one of the deprecated classes.
That SQLAlchemy has such low release numbers, and it's written by that
scofflaw M. Bayer. Nobody should use it until 1.0, he should stick to
directing Hollywood blockbusters. ;-)
--
You r
SQLAlchemy 0.7 deprecates SessionExtension() and other abstract base classes
and replaces them with an event interface.
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubs
transaction manager - calls -> repoze.bfg^Wpyramid -> your view
Your view returns, pyramid pops the threadlocal context used by
get_current_request, and then the transaction manager commits.
You can't get the threadlocal request anymore because Pyramid has already
done its cleanup and popped the
None of those points say anything about a perfect implementation of
coroutines (I heard lua has the best ones) versus callback-style or some
other more-stackful-style of asynchronicity. On the other hand for example
I'm sure there is a lot of Twisted code that doesn't need to be rewritten. I
ju
Proposal: import eventlet
Done! Invented in 1963, coroutines let me use WSGI asynchronously without
rewriting anything. What could be sweeter?
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@goo
Joe,
I enjoy posting to mailing lists but as far as I'm concerned you may change
the name of things without asking in the future. I have already read the
docs and would probably never notice.
Daniel
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" g
When the almost-exactly-the-same-but-irritatingly-slightly-different version
of paster has templates, sure. When paster create --list-templates is the
only way to show the available scaffolding, no way! Real people can
understand adjectives and compound terms.
Also, 'template' and 'paster templ
The normal strategy for databases is to use a connection pool. Conceptually
the code gets a new connection each request but the pool may return an
existing connection instead. Depending on the database this can be a big
win; some databases connect so quickly that it hardly makes a difference.
-
Pyramid will normally only call one view per request. Is there a reason you
cannot simply call view2 from view1?
def view1(request):
x = view2(request)
...
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send em
IMO the only thing we need for configuration is a 100% compatible, no extra
features version of Paster that is easier to read and extend, and that runs
on Python 3.2. Call it 'baster'. It will understand Paster entry points,
paste deploy .ini files and be able to 'baster serve'. The templating
feat
In this case it only means "replace the function with its return value as a
kind of cache"
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send
p at
http://groups.google.com/group/pylons-devel?hl=en.
"""
Test forking and Request.copy().
This test should be skipped on Windows.
Daniel Holth
"""
from multiprocessing import Process
from webob import Request, Response
from wsgiref.simple_server import make_server
impor
I have been having trouble with request.copy() and ReloadWSGI with WebOb >=
1.0.2.
In WebOb 1.0.2 and greater request.copy() hangs. static_url() uses
request.copy() so my Pyramid application hangs as soon as it tries to serve
some css.
In WebOb 1.0.4 from pypi, it hangs at request.py:673 which
My wishlist for the manual:
1. searching for request.response_headers should pull up
request.response_headerlist
2. glossary for 'Configurator' etc. should link to function signatures
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to t
Pasta is delicious. Choice is here to stay.
I think frustrated people tend to overestimate the cost of reading a
600-page book (the documentation) or installing 17 dependencies
(automatically). It will pay off to understand the tools you are using over
the lifetime of a significant application;
Psychologists have done a significant amount of research documenting the
"tyranny of choice" and famously served samples of exotic jams "when choice
is demotivating" (
http://www.columbia.edu/~ss957/articles/Choice_is_Demotivating.pdf). At
least for jam, 6 choices is OK, while 30 choices are demoti
Wrap « in webhelpers.html.literal() or ...set # -*- coding: utf-8 -*-
in your Python file and just pass the unicode character to the batcher.
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@goog
Clearly it will take time for individuals to understand which functionality
best belongs in each layer. REMOTE_USER makes great middleware but it's
trivial to move that bit, or sessions, into or out of Pyramid as desired.
--
You received this message because you are subscribed to the Google Gro
I think the reasoning is that
"Interpret the current user id from a cookie / kerberos authentication /
some key in the session"
and
"see whether the identified user exists in our system"
should be in different layers. I agree this leaves me scratching my head as
to when the distinction is usefu
On Sun, Feb 27, 2011 at 2:15 PM, oO wrote:
> Sorry if this is a basic question, but as I'm starting to add more and
> more layers of complexity to my first pyramid based applications, I'm
> starting to wonder about some of the benefits of using pyramid
> specific implementations as opposed to re-
There is a constant. It is called pyramid.interfaces.NO_PERMISSION_REQUIRED
; however, the string is documented. This probably makes the documentation
shorter because you would have to use the string if you are configuring with
ZCML.
This is /only/ required at all when you need your application to
If you do it properly, you can .get(primary_key) the user from the
SQLAlchemy session and it only hits the storage once per transaction. If the
object hasn't been garbage collected, subsequent .get() calls will hit the
identity map, which can be used as a kind of cache but which is really there
I did something like this too. I need to be able to show readonly fields in
my forms in the same way I do in formish, so I implemented a per-field
readonly flag. It works okay but it is a little cumbersome to specify which
fields are readonly:
deform/field.py:
def serialize(self, cstruct, re
I think you are correct.
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to
pylons-devel+unsubscr...@googlegroups.com.
For more optio
If you want to use the global ZCA then you should call
Configurator.hook_zca. See
http://docs.pylonsproject.org/projects/pyramid/dev/api/config.html#pyramid.config.Configurator.hook_zca
Global ZCA means calls to
zope.component.getUtility(ISomething)
instead of
request.registry.getUtility(ISomet
cache_key = " ".join(map(str, deco_args + args))
One way is to define a __str__ method for your class that doesn't include
the object's id()
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@goog
Kyle,
You should be able to do something as simple as
class Foo:
bars = relationship(Bar, backref='__parent__')
Is it necessary? With the default traversal implementation you override
__getitem__ to return objects with __name__ and __parent__:
def __getitem__(self, key):
b
Typically my models are not very smart, so I am not usually worried about
model-bugs interfering with other tests and I just insert real ones into a
sqlite:///:memory: database. However,
def view_under_test(request):
return
dict(user_id=request.db.query(User).get(authenticated_userid(reques
I think it is very relaxing that my view handles unedited requests. I'm
confused about the problem you are having. Since the framework keeps GET
requests out, why does the PUT-handler have to check request.method at all?
--
You received this message because you are subscribed to the Google Grou
I always setup two view functions, one for GET and one for POST.
I don't do PUT, but if you want Pyramid lets you condition a view on both
the request method and parameters. The second function should only be called
for a PUT, or a POST with _method=PUT in the parameters:
def some_method(reques
its dependencies.
Thanks,
Daniel Holth
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to
pylons-devel+unsubscr...@google
r to understand and test, and there is no need to
agree on a common module to hold those globals.
Daniel Holth
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
that needs logins.
I hope someone will find it useful. Let me know if you give it a try.
http://pypi.python.org/stucco_auth
https://bitbucket.org/dholth/stucco_auth
Thanks Rocky for your contributions.
Daniel Holth
--
You received this message because you are subscribed to the Google Groups
&q
In that case, in the function that creates your application:
c = Configurator(settings)
e = Environment(auto_reload=asbool(settings['auto_reload']))
c.registry.registerUtility(e, IJinja2Environment)
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" grou
Stephane,
{{ request.registry.settings }}
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to
pylons-devel+unsubscr...@googlegroups.c
I am interested in supporting multiple packages that depend on each other's
tables as a directed acyclic graph and do not import a common declarative
base. To support that goal I've been working on stucco_evolution.
stucco_evolution is an extension of repoze.evolution that works with
SQLAlchemy
Look at the view_attr and request_method parameters to add_route. If you
have a naming convention for your classy views it should be extremely easy
to do something like (untested):
class ViewClass(object):
def __init__(self, request):
self.request = request
def GET(self):
+1 'resource' is awesome. I retract all my previous objections. Thanks
wordsmiths Mark and Chris.
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group,
-1 I think the word 'resource' is at least as overloaded as the word
'model'.
If it's a graph it could contain nodes?
After an "aha" moment, I always thought of my bfg app as having a traversal
model /and/ a data model, with the leaves of the traversal model tending to
be SQLAlchemy mapped cla
Pyramid calls a view with the request if it accepts one positional
argument, but the cache decorator hides the function's signature so
Pyramid passes the context and the request.
If you change your view to
def home_view(context, request):
pass
It will probably do something. However, str(context)
Massimiliano,
I went down the same path of looking for a per-request caching middleware
that worked in the same way as the session middleware. Eventually I decided
caching was not tied to a single request in the same way as a session, so I
have a global cache as Wichert suggests.
Daniel
--
You
I don't know what all you guys are smoking with this half-cocked "routes"
system. Personally it makes no sense to me. I started developing web pages
by putting index.html in a folder, and if I visited that folder I would see
index.html. Now I put an object in a nested dict, the framework finds it,
ommon enough to be a default feature.
I've been using repoze.bfg for a little more than a year. I have a few
repoze.bfg and now Pyramid applications that use SQLAlchemy but I have
not finished figuring out how to factor out the common parts.
Daniel Holth
--
You received this message becau
On the other hand, when I configure my engine from the .ini it's just
configure_engine(settings['sqlalchemy.url'])
So I think the way it works now is fine.
Daniel Holth
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To
.html#sqlalchemy.orm.scoping.ScopedSession.query_property
However, a class could be written as:
from sqlalchemy.orm.util import object_session
...
def do_something_with_session(self):
object_session(self).query()...
- Daniel Holth
--
You received this message because you are subscribed to the Google Groups
"pylons-devel&
PYRAMID_DEBUG_AUTHORIZATION=1 chris?)
Daniel Holth
--
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to
pylons-devel+unsubscr...@googlegroups.com
59 matches
Mail list logo