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 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 > wrote: > > > > > You might also look at the pyramid-log > > > <https:/

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 want. It provides a custom

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 wrote: > On Tue, Feb 7, 2017 at 2:38 PM, Jeff Dairiki wrote: > > > > > > On Mon, Feb 6, 2017 at 11:25 AM, Jonathan Vanasco > > > wrote: > >> > >> > >> > >> On Sunday, February 5, 2017 a

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 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 session. However these simpl

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 in the session cookie,

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 latte

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 Jinja2, but it doesn't

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 which

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

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 the

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' log

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

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

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 resolv

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 pyramid.pas

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 o

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

Re: [pylons-discuss] Re: Fanstatic options issue

2013-11-07 Thread Jeff Dairiki
On Wed, Nov 06, 2013 at 02:23:31PM -0800, Mike Orr wrote: > Further problems. > > File > "/home/mikeorr/.virtualenvs/p2/local/lib/python2.7/site-packages/pyramid_fanstatic/__init__.py", > line 63, in __call__ > result = needed.render_topbottom_into_html(response.body) > AttributeError: 'Nee

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 explai

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'

Re: [deform] Allowing 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 > HTML tag in fields. Has anyone written their own widget that > offers this? I added this feature in a fork for now > (https://github.com/dbaty/deform/commit/67c265c560dad

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

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 FileAp

Re: Best practice on using Deform with placeholder attributes

2011-08-17 Thread Jeff Dairiki
all the form fields. (The form uses method=GET, so just look at the URL you end up at to see the submitted values.) Jeff > On Aug 13, 12:09 pm, Jeff Dairiki wrote: > > On Fri, Aug 12, 2011 at 02:57:18PM -0700, Bobby wrote: > > > The desired outcome is an input field filled wi

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

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 se

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 & &g

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

2010-11-24 Thread Jeff Dairiki
Here's my second question. URL generation seems awkward when using hybrid URL dispatch & traversal. I suspect I'm missing something what is it? I have a route like: config.add_route('admin', 'admin/*traverse', factory='.models.get_admin_root') and a bunch of views defined with route_name

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 .