Re: [pylons-discuss] can i add something to the pyramid logging ?

2017-06-01 Thread Jeff Dairiki
On Thu, Jun 1, 2017 at 10:42 AM, Steve Piercy <steve.piercy@gmail.com> wrote: > On 6/1/17 at 12:07 PM, mmeri...@gmail.com (Michael Merickel) pronounced: > > > On Thu, Jun 1, 2017 at 11:52 AM, Jeff Dairiki <dair...@dairiki.org> > wrote: > > > > &

Re: [pylons-discuss] can i add something to the pyramid logging ?

2017-06-01 Thread Jeff Dairiki
On Fri, May 26, 2017 at 8:04 PM, Guohuang Chen wrote: > can i add something to the pyramid logging ? such as session['login_name'] > remote-ip ... > You might also look at the pyramid-log package. I think it will do what you

Re: [pylons-discuss] does anyone have a server-side session library other than pyramid_redis_sessions ?

2017-02-08 Thread Jeff Dairiki
On Tue, Feb 7, 2017 at 6:28 PM, Mike Orr <sluggos...@gmail.com> wrote: > On Tue, Feb 7, 2017 at 2:38 PM, Jeff Dairiki <dair...@dairiki.org> wrote: > > > > > > On Mon, Feb 6, 2017 at 11:25 AM, Jonathan Vanasco <jonat...@findmeon.com > > > > wrote:

Re: [pylons-discuss] does anyone have a server-side session library other than pyramid_redis_sessions ?

2017-02-07 Thread Jeff Dairiki
On Mon, Feb 6, 2017 at 11:25 AM, Jonathan Vanasco <jonat...@findmeon.com> wrote: > > > On Sunday, February 5, 2017 at 4:16:29 PM UTC-5, Jeff Dairiki wrote: >> >> >> Actually, no. Pretty much every page includes a CSRF token somewhere, >> and thus require a

Re: [pylons-discuss] does anyone have a server-side session library other than pyramid_redis_sessions ?

2017-02-05 Thread Jeff Dairiki
On Fri, Feb 3, 2017 at 6:37 PM, Jonathan Vanasco wro > > > So I assume you defer creating a null session until it's used? > Actually, no. Pretty much every page includes a CSRF token somewhere, and thus require a session. However these simple sessions are stored entirely

Re: [pylons-discuss] does anyone have a server-side session library other than pyramid_redis_sessions ?

2017-02-03 Thread Jeff Dairiki
I have written a custom session implementation which is a hybrid between cookie-storage and redis-storage. If the session dict is JSON-serializable and is not too large, then the session is just stored directly in a cookie. Otherwise, the session data is pickled and stored in redis. In the

Re: [pylons-discuss] need guidance for Pyramid, Jinja2, deform combination

2015-11-20 Thread Jeff Dairiki
On Fri, Nov 13, 2015 at 4:40 AM, kk wrote: > I guess I said all in my subject line. > I would love if I can have templates in jinja2 and use deform library > together with Pyramid. I do this. It "just works." The stock templates which come with deform are Chameleon, not

Re: [pylons-discuss] fine-tuning a deployment under uwsgi + supervisord

2015-11-10 Thread Jeff Dairiki
I'm not arguing that this is the best way, but as a data point, here's what I do. I use buildout to generate app.ini, as well as other config files, including for uwsgi and supervisord, from templates (using collective.recipe.template.) I have several top-level buildout config files, all of

Re: [pylons-discuss] resource and data with zodb

2015-07-29 Thread Jeff Dairiki
If you're thinking about using ZODB in a new pyramid-based app, definitely look into SubstanceD http://www.substanced.net/, which provide pre-built admin UII (and more) for ZODB-based web apps. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To

Re: [pylons-discuss] Explicit reissue of auth_tkt cookie

2015-07-09 Thread Jeff Dairiki
Another way to ensure that authentification happens every request: @subscriber(NewRequest) def refresh_auth_cookie(event): event.request.unauthenticated_userid As a side-note, if you happen to be using pyramid_tm, its tween is probably already doing this for you. Unless disabled by one of

Re: [pylons-discuss] How to configure authentication for testing

2015-06-18 Thread Jeff Dairiki
One way is to step through the whole login procedure. I.e. make sure your test app is configured with a particular user (and password) in its user db, then so something like:: res = self.app.get('/login') login_form = res.forms['login-form'] login_form['username'] = 'someuser'

Re: [pylons-discuss] Re: Graceful degrading on bad Beaker session

2014-02-19 Thread Jeff Dairiki
On Wed, Feb 19, 2014 at 12:54:04PM -0800, Jonathan Vanasco wrote: I think you'd need to have an `id` in ISession as an attribute. If I understand your motives — it's quite possible that I don't — you want access to the session id in order to access extra externally stored session data (e.g. from

Re: [pylons-discuss] Graceful degrading on bad Beaker session

2014-02-16 Thread Jeff Dairiki
On Sun, Feb 16, 2014 at 12:36:51PM -0600, Theron Luhn wrote: Thanks for letting me know. I'll look into pyramid_redis_sessions. Not meaning to fan a smoldering thread here, but, if cookie-based session storage (where all the data goes in the cookie and there is no server-side storage of session

Re: [pylons-discuss] NotFound views and AddSlash

2014-02-10 Thread Jeff Dairiki
On Mon, Feb 10, 2014 at 10:45:00AM -0800, Jonathan Vanasco wrote: hoping someone has a suggestion... we run `pyramid.view.append_slash_notfound_view` as a convenience for people writing in bad urls. on one of our newer views, we need to raise an authoritative 404. ie, This is a 404 ,

Re: [pylons-discuss] pyramid_mailer ComponentLookupError:

2013-11-16 Thread Jeff Dairiki
On Sat, Nov 16, 2013 at 05:33:37PM +1300, Matt Smith wrote: On 16/11/13 16:53, Jeff Dairiki wrote: Okay, now can you show the rest of your app configuration (your main)? No need. I tryed the straight python way again with smtplib and it works fine. So that resolves my issue

Re: [pylons-discuss] pyramid_mailer ComponentLookupError:

2013-11-15 Thread Jeff Dairiki
On Sat, Nov 16, 2013 at 10:05:43AM +1300, Matt Smith wrote: On 16/11/13 07:32, Jonathan Vanasco wrote: can you show your view callable ? Okay, now can you show the rest of your app configuration (your main)? If you have a view, it's not a console script, so I think anything about

Re: [pylons-discuss] Testing using webtest and pyramid_mailer

2013-11-11 Thread Jeff Dairiki
On Mon, Nov 11, 2013 at 03:47:47PM -0800, Kristian wrote: Thanks Jeff, that led me to find the registry in the app. It works using that registry : # As simple as calling this in the unittest registry = self.testapp.app.registry mailer = get_mailer(registry) Slick! I didn't realize one

Re: [pylons-discuss] Testing using webtest and pyramid_mailer

2013-11-09 Thread Jeff Dairiki
On Sat, Nov 09, 2013 at 12:27:11PM +0100, Gael Pasgrimaud wrote: Hi, On Fri, Nov 08, 2013 at 08:06:09PM -0800, Kristian wrote: I'm using webtest to test a functionality that send an email. I want to catch the email in my unittest and get a url in the mail to further test. Only problem,

Re: Distinguishing between view names

2012-06-15 Thread Jeff Dairiki
On Fri, Jun 15, 2012 at 12:38:37PM -0700, Jason wrote: On Friday, June 15, 2012 3:11:22 PM UTC-4, Theron Luhn wrote: A lot of times I use the same view for both editing items and making new items. How can I determine which view name is being called? I know I'm not explaining

Re: Accessing a beaker session object from within Deform fileuploadWidget's tmpstore

2012-04-07 Thread Jeff Dairiki
On Fri, Apr 06, 2012 at 08:54:40AM +0200, tonthon wrote: I'm building a FileUploadTempStore to handle file upload with deform and I'm wondering how to access my beaker session object. It works using : session = pyramid.threadlocal.get_current_request().session But since I shouldn't abuse

Re: [deform] Allowing optgroup HTML tags in SelectWidget

2012-04-04 Thread Jeff Dairiki
On Wed, Apr 04, 2012 at 05:41:12PM +0200, Damien Baty wrote: The current 'deform.widget.SelectWidget' cannot render any optgroup HTML tag in select fields. Has anyone written their own widget that offers this? I added this feature in a fork for now

Re: trying to create a pdf version of the pyramid cookbook...

2012-02-24 Thread Jeff Dairiki
On Sat, Feb 25, 2012 at 02:05:29AM +0100, Andreas Reuleaux wrote: Hm, not really, sorry: (~)$ git clone https://github.com/Pylons/pyramid_cookbook.git (~)$ cd pyramid_cookbook/ (~/pyramid_cookbook)$ make html sphinx-build -b html -d _build/doctrees . _build/html Running Sphinx

Errors on deform HiddenWidget

2011-09-13 Thread Jeff Dairiki
I'm using a HiddenWidget to pass a CSRF token in a deform form. I've noticed that when the CSRF token is wrong, at the top of the re-displayed form I get: There was a problem with your submission Errors have been highlighted below But the error isn't highlighted below. Is this a bug or am I

Re: add_static_view for a single file

2011-08-25 Thread Jeff Dairiki
On Thu, Aug 25, 2011 at 05:58:06AM -0700, Luca Frosini wrote: does anyone knows if it possible to add_static_view for a single file. I would like use override assets for that file and I can't match it with some prefix. What I did in this case was to write a thin wrapper around paste's FileApp.

Re: Best practice on using Deform with placeholder attributes

2011-08-17 Thread Jeff Dairiki
look at the URL you end up at to see the submitted values.) Jeff On Aug 13, 12:09 pm, Jeff Dairiki dair...@dairiki.org wrote: On Fri, Aug 12, 2011 at 02:57:18PM -0700, Bobby wrote: The desired outcome is an input field filled with a default value that is removed when the field is focused

Re: Best practice on using Deform with placeholder attributes

2011-08-13 Thread Jeff Dairiki
On Fri, Aug 12, 2011 at 02:57:18PM -0700, Bobby wrote: The desired outcome is an input field filled with a default value that is removed when the field is focused. I haven't actually tried this yet (sorry), but I plan on just using the HTML5 placeholder attribute. As far as deform is involved

Pyramid question: mako.default_filters?

2010-11-24 Thread Jeff Dairiki
I've just started work on a project using Pyramid (1.0a4). So far Pyramid looks very, very nice. Thank you! I have a couple stupid questions. Here's the first one (the second will be in a subsequent post.) (This one may actually be a bug report.) I'm trying to get the mako.default_filters

Re: Question: URL generation under hybrid URL dispatch / traversal in Pyramid

2010-11-24 Thread Jeff Dairiki
Hi Chris, Thanks for the answers! On Wed, Nov 24, 2010 at 03:11:01PM -0500, Chris McDonough wrote: On Wed, 2010-11-24 at 10:08 -0800, Jeff Dairiki wrote: Here's my second question. URL generation seems awkward when using hybrid URL dispatch traversal. I suspect I'm missing something

Re: Pyramid question: mako.default_filters?

2010-11-24 Thread Jeff Dairiki
On Wed, Nov 24, 2010 at 06:44:20PM -0500, Chris McDonough wrote: On Wed, 2010-11-24 at 10:01 -0800, Jeff Dairiki wrote: I'm trying to get the mako.default_filters .ini file setting to work. It doesn't seem to. If, in my .ini file, I set mako.default_filters = h then as soon