Re: [pylons-discuss] Re: Site https://docs.pylonsproject.org is not working

2017-06-29 Thread Jonathan Vanasco
On Thursday, June 29, 2017 at 2:55:55 PM UTC-4, Steve Piercy wrote: > > What can we do when RTD has an outage? > You may be able to minimize an outage by using a free CloudFlare or similar account. Usually you can keep something in their cache for long-enough to miss periodic downtime.

[pylons-discuss] Re: pyramid_sqlalchemy_sessions add-on

2017-06-25 Thread Jonathan Vanasco
FWIW i'm not sure if this applies to your code or not, but a few things to look out for in writing server-side libraries in pyramid: 1. make sure you're only 'writing' the session once (a few libraries had written on each change) 2. a few libraries have done a preliminary check to see if a

[pylons-discuss] Re: SQLAlchemy scoped_session not removed by transaction manager

2017-06-22 Thread Jonathan Vanasco
1. You probably shouldn't use a global sqlalchemy session like that. It is the cause of many developer's problems. There should probably be a ticket to remove/update that howto, so it references the current cookiecutter -- which stashes the session onto the request. 2. pyramid_tm doesn't

Re: [pylons-discuss] Re: Pyramid 1.9b1 released

2017-06-21 Thread Jonathan Vanasco
On Wednesday, June 21, 2017 at 10:47:26 PM UTC-4, Mike Orr wrote: > > > How do you get a secondary session? Can you do that with Pyramid's > session infrastructure? Originally I extended Pyramid to have a ISessionHttpsFactory class that binds to `request.session_https` and basically

[pylons-discuss] Re: Logging out with AuthTktAuthenticationPolicy

2017-06-21 Thread Jonathan Vanasco
On Tuesday, June 20, 2017 at 1:01:05 PM UTC-4, Mike Orr wrote: > > That says that storing the user ID in a cookie is a bad idea, but > isn't that what AuthTktAuthenticationFactory does? > Storing a user_id AS the cookie payload for auth is a bad idea. Storing a user_id IN a signed (or

Re: [pylons-discuss] Re: Pyramid 1.9b1 released

2017-06-20 Thread Jonathan Vanasco
On Tuesday, June 20, 2017 at 12:23:44 PM UTC-4, Michael Merickel wrote: > > I guess I felt like the notes at [1] were fairly informative. What did > you have in mind? > I was hoping for someone to handle any gotchas, stuff like "you did that, now do this", and potential ways the CSRF stuff

[pylons-discuss] Re: Pyramid 1.9b1 released

2017-06-20 Thread Jonathan Vanasco
has anyone written a migration guide for the CSRF stuff yet? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscr...@googlegroups.com. To

[pylons-discuss] Re: Adding Firebase Authentication

2017-06-04 Thread Jonathan Vanasco
There are a handful of JWT packages for Pyramid This is probably the most used and one of (if not the) best written: https://github.com/wichert/pyramid_jwt -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and

[pylons-discuss] Re: WSGI WebSockets AsyncIO server for Pyramid

2017-05-19 Thread Jonathan Vanasco
If you drop AsyncIO for another ansyc container, these links might help. They popped up on the twisted list last week. Hendrix is a bridge for Twisted and WSGI. Pyramid should work on it. * https://hendrix.readthedocs.io/en/latest/ There is also another project, twist-wsgi *

[pylons-discuss] Re: Feedback needed from Agendaless Consulting on copyright, trademark, etc issues

2017-05-14 Thread Jonathan Vanasco
As a non-core contributor to the ecosystem and user: 1. Is that a typo on the copyright of the agendaless website? isn't it "Fredericksburg" ? 2. I'm not a fan of the code license, but it's no big deal. i'd much rather see the MIT license or similar. The one-half interest assignment is a

[pylons-discuss] feedback/testing wanted - pyramid_debugtoolbar_api_sqlalchemy

2017-05-10 Thread Jonathan Vanasco
Thanks to some changes in debugtoolbar 4.0 by Michael Merickel, I was able to update and release our SqlAlchemy profiling tool * via pip/pypi `pyramid_debugtoolbar_api_sqlalchemy` * via github https://github.com/jvanasco/pyramid_debugtoolbar_api_sqlalchemy This package relies on the existing

Re: [pylons-discuss] troubleshooting 1.7.4 - 1.8 migration

2017-05-06 Thread Jonathan Vanasco
This popped up again. I spent a few hours trying to narrow down what package update is causing this and can't. This happens under waitress in the 1.8.1/2/3 branches on `pserve --reload environment.ini` but not on `pserve environment.ini` (i used the full path, this is shorthand) does anyone

[pylons-discuss] Re: API versioning with routes using Pyramid

2017-04-24 Thread Jonathan Vanasco
We typically handle it like this... For these routes/files /v2/veryimportantroute <> views/api/v2.py /v3/veryimportantroute <> views/api/v3.py we tend to proxy the actual API functions to something like lib.api.veryimportantroute.py def v2() def v3() the url routing is

Re: [pylons-discuss] Re: plaster 0.3 and plaster_pastedeploy 0.1

2017-04-19 Thread Jonathan Vanasco
On Wednesday, April 19, 2017 at 1:40:13 PM UTC-4, Michael Merickel wrote: > > > Thanks - I have not. I imagine they would depend on plaster instead of > pastedeploy and then advise people to install the appropriate binding for > whatever wsgi config format they are using... Such as

[pylons-discuss] Re: plaster 0.3 and plaster_pastedeploy 0.1

2017-04-19 Thread Jonathan Vanasco
this looks pretty great. have you spoken with the maintainers of uwsgi / gunicorn / etc about plaster support yet? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an

[pylons-discuss] Re: pyramid_beaker needs a maintainer

2017-03-20 Thread Jonathan Vanasco
What about officially sunsetting it? * beaker is not actively maintained, and has not been for years * pyramid handles the client-side sessions natively * there are many maintained plugins for server-side sessions * caching of components can be done by packages like dogpile, which are actively

Re: [pylons-discuss] Re: Pyramid application as authentication and datas provider

2017-03-17 Thread Jonathan Vanasco
On Friday, March 17, 2017 at 1:49:19 PM UTC-4, tonthon wrote: > > Have you tried https://github.com/elliotpeele/pyramid_oauth2_provider ? > It seems to miss some use cases but it covers quite well the oauth2 > workflow > This looks a lot like my oauth1 solution. -- You received this

[pylons-discuss] Re: Problem with Pyramid 1.8 and pdb session

2017-03-15 Thread Jonathan Vanasco
I've run into variations of this before under a few scenarios: - a new version of pyramid or a plugin may handle static/etc resources slightly differently - a browser may emit a secondary request for the 'view source' window if you have it open for debugging html -- You received this message

[pylons-discuss] Re: Pyramid application as authentication and datas provider

2017-03-14 Thread Jonathan Vanasco
We do the same thing. A few notes: * I run the authorization API as a standalone app/service, and also run the read/write APIs as a third service. Our services have hit the api with their endpoint in their path (ie /api/v1/app1 /api/v1/app2) so they can be partitioned out later if needed and

Re: [pylons-discuss] Re: a friendly warning about upcoming changes to pyramid_tm

2017-03-06 Thread Jonathan Vanasco
> > Yes, it is a giant pain. That's why I wanted to warn people explicitly in > this case because I don't want anyone suffering dataloss because their > transaction manager changed. > That's why I brought this up - this is a bit more of a 'dangerous' API change. People following

[pylons-discuss] Re: a friendly warning about upcoming changes to pyramid_tm

2017-03-06 Thread Jonathan Vanasco
On Friday, March 3, 2017 at 2:30:09 AM UTC-5, Michael Merickel wrote: > > TLDR - You may want to pin 'pyramid_tm < 2.0' until you have a chance to > understand the changes. > two comments: 1. have you considered marking `pyramid_tm` as end-of-life, and pushing for the new changes as

Re: [pylons-discuss] troubleshooting 1.7.4 - 1.8 migration

2017-03-03 Thread Jonathan Vanasco
Circling back again, this popped up on another machine yesterday. >From what I can tell the problem wasn't waitress, but "some random dependent package(s)" that were updated via pip installing a required package. re-installing waittress in the first environment caused an issue. in the second

Re: [pylons-discuss] Pylons Project GSoC 2017

2017-03-01 Thread Jonathan Vanasco
It might make sense to group most of those WebOb bulletpoints (save the tests & last one) into a single "WebOb Upgrades" project. Looking at some of the past Python accepted projects (https://summerofcode.withgoogle.com/archive/2016/projects/), the accepted projects tend to be a widespread

Re: [pylons-discuss] troubleshooting 1.7.4 - 1.8 migration

2017-02-27 Thread Jonathan Vanasco
On Monday, February 27, 2017 at 5:31:42 PM UTC-5, Bert JW Regeer wrote: > > What WSGI server are you using? > That solved it fast -- `waitress ` just needed to be updated. That testing environment had v0.8.5. It works fine on the current version, and immediately passed staging testing

[pylons-discuss] troubleshooting 1.7.4 - 1.8 migration

2017-02-27 Thread Jonathan Vanasco
I'm looking at upgrading a deployment to 1.8 and running into an issue with pserve The application runs fine under 1.7.4. Under 1.8 it starts up, but won't serve. Instead I'll see this output on the terminal on a request, before it jams up pthread_cond_wait: Invalid argument Can anyone

Re: [pylons-discuss] What is your development environment setup?

2017-02-24 Thread Jonathan Vanasco
On Thursday, February 23, 2017 at 1:42:16 PM UTC-5, Oliver Berger wrote: > > The key to have a distinct, reproducible setup and deployment is to use > pyenv/virtualenv I prefer simply requiring my team using `virtualenv` and host behind a standardized nginx setup (that mimics production).

[pylons-discuss] Re: Autonatic login to applications using Pyramid

2017-02-15 Thread Jonathan Vanasco
On Wednesday, February 15, 2017 at 11:02:43 AM UTC-5, annut...@gmail.com wrote: > > > I want to send user's credentials to the application and automatically > login the user when user clicks the button/link. > > Is it possible to achieve this without using ajax ? > Instead of sending the

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

2017-02-08 Thread Jonathan Vanasco
On Wednesday, February 8, 2017 at 5:54:57 PM UTC-5, Jeff Dairiki wrote: > > > If there's real interest in it, I can look into splitting it into it's own > library. > I'd be interested in seeing it. I don't know if we'd be able to use it, as we need to force some things to be stored server

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

2017-02-06 Thread Jonathan Vanasco
On Monday, February 6, 2017 at 6:18:02 PM UTC-5, Bert JW Regeer wrote: Don’t touch request.session… > I wish! We have to do a read for login status and some other things. Pushing that into a secondary session was an option, but that's gone. Could create a pass-through session factory that

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

2017-02-06 Thread Jonathan Vanasco
On Monday, February 6, 2017 at 3:21:45 PM UTC-5, Mikko Ohtamaa wrote: > > 30k sessions should not be an issue yet. I had 400k sessions and no issues > there. Redis should be very high amount of keys easily. > We don't have a problem now, but will in the future. Right now we're forecasting

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

2017-02-06 Thread Jonathan Vanasco
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 simple sessions are stored entirely > in the session cookie, so no server-side storage is required. >

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

2017-02-03 Thread Jonathan Vanasco
That sounds pretty smart. So I assume you defer creating a null session until it's used? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to

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

2017-02-03 Thread Jonathan Vanasco
I forked `pyramid_redis_sessions` into a new project because my needs changed. i ended up inheriting a design flaw and need to refactor it out. I'm hoping to look at other server-side session systems for inspiration. my issue is that not having a session_id cookie, or having an invalid one,

Re: [pylons-discuss] pyramid_tm custom data mangers for a transaction

2017-01-31 Thread Jonathan Vanasco
On Tuesday, January 31, 2017 at 1:04:25 PM UTC-5, Mike Orr wrote: > Your logs must be for a different purpose than mine. Not really. I log most of the same things as you, and usually aggregate at the end too. The exception is that we run statsd as well, and that logs in real time. But

Re: [pylons-discuss] pyramid_tm custom data mangers for a transaction

2017-01-30 Thread Jonathan Vanasco
On Sunday, January 29, 2017 at 12:44:57 PM UTC-5, Mike Orr wrote: > > I sometimes use a separate database connection with autocommit for > logging, but I do it in a request finalizer. I also do it in a > separate database because the database becomes large and other > applications use it too.

Re: [pylons-discuss] pyramid_tm custom data mangers for a transaction

2017-01-28 Thread Jonathan Vanasco
On Saturday, January 28, 2017 at 2:06:11 PM UTC-5, Mike Orr wrote: > > > How are people synchronizing something transactional with something > non-transactional, especially a database record with a filesystem > file. > I deal with this a lot in the area of S3 file archiving. I abort the

Re: [pylons-discuss] functional test in pyramid using pytest

2017-01-27 Thread Jonathan Vanasco
On Thursday, January 26, 2017 at 1:39:50 AM UTC-5, Steve Piercy wrote: > > I'd be interested in hearing more, both for and against, about a switch. A strength of Pyramid is that you can complete a task in almost any way imaginable. This translates to a bit of a weakness though, in that

Re: [pylons-discuss] functional test in pyramid using pytest

2017-01-25 Thread Jonathan Vanasco
On Tuesday, January 24, 2017 at 4:50:55 PM UTC-5, Steve Piercy wrote: > > Take a look at this step in the SQLAlchemy + URL Dispatch wiki tutorial. > > http://docs.pylonsproject.org/projects/pyramid/en/latest/tutorials/wiki2/tests.html > +1 for that tutorial. one of the projects we

Re: [pylons-discuss] pyramid_tm custom data mangers for a transaction

2017-01-24 Thread Jonathan Vanasco
On Monday, January 23, 2017 at 1:26:08 PM UTC-5, Michael Merickel wrote: > > The best resource I know is > http://zodb.readthedocs.io/en/latest/transactions.html along with staring > at various implementations of data managers. A good one to look at would be > zope.sqlalchemy which is the

Re: [pylons-discuss] Pyramid 1.8 released

2017-01-22 Thread Jonathan Vanasco
On Sunday, January 22, 2017 at 8:04:20 AM UTC-5, Eldav wrote: > > > I only have one regret regarding to this: creating projects from > cookiecutter "scaffolds" now requires an Internet connection, and > depends on a commercial service (GitHub). Unless, of course, you > remembered to clone

Re: [pylons-discuss] uWSGI logging issues with Pyramid

2017-01-20 Thread Jonathan Vanasco
On Friday, January 20, 2017 at 12:13:07 PM UTC-5, Zsolt Ero wrote: > > I was thinking of that as well, but it implies using the same ini file, > which I'd like to keep separate. > yes, i believe it does. i set all my uwgsi options via commandline flags, so ini-paste-logged works for me. it

Re: [pylons-discuss] uWSGI logging issues with Pyramid

2017-01-20 Thread Jonathan Vanasco
I think the command you want in uwsgi is `ini-paste-logged` instead of `paste` http://uwsgi-docs.readthedocs.io/en/latest/Options.html?highlight=paste-logger#ini-paste-logged -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe

Re: [pylons-discuss] Pyramid 1.7.3 Using HTTPFound exception for JSON response when resource not found in backend database.

2016-12-15 Thread Jonathan Vanasco
Since you explicitly want to return a JSON error (and not adapt a response for the path) I can offer another strategy (which i use). This is from memory so the code may need some tweaking. (working from home today and don't have the source) 1. Define a custom class for JSON exceptions:

[pylons-discuss] quick trick for changing exceptions to json

2016-12-06 Thread Jonathan Vanasco
Like many others, I've struggled with getting Pyramid to render JSON exceptions. Thanks to a few recent updates to Pyramid and WebOb, things got a whole lot easier. The new behavior allows for JSON to be generated based on the "accept" request headers. Unfortunately, sending this header

[pylons-discuss] returning dynamic json exceptions

2016-12-06 Thread Jonathan Vanasco
A few people, myself included, have struggled with this in the past. While some recent PRs in webob and pyramid will adjust a response if "application/json" is in the HTTP_ACCEPT environment, I've run into a few situations where low-level clients don't (easily) have the ability to specify

[pylons-discuss] announce: beta release of pyramid_forksafe, feedback requested

2016-11-15 Thread Jonathan Vanasco
I recently had to update our production deployment to address a forking issue with mongodb, and realized that our "post fork" cleanup routine was built directly against the uWSGI API -- creating some technical debt. The solution was a new library that I'd appreciate feedback on:

[pylons-discuss] response caching (and a possible docs error)

2016-09-13 Thread Jonathan Vanasco
This is an extension of something I brought up about a year ago. I'm unhappy with my current approach and trying to figure out a better way to implement this. I'm not sure it might be possible though. When it comes to "public urls", our application caches responses from views as a tuple of

Re: [pylons-discuss] view_config's wrapper - example?

2016-09-13 Thread Jonathan Vanasco
On Tuesday, September 13, 2016 at 2:24:44 PM UTC-4, Michael Merickel wrote: > > It has very very limited use. You can see exactly what it does from its > implementation as a view deriver. > thanks. this does seem awkward to use. -- You received this message because you are subscribed to the

[pylons-discuss] view_config's wrapper - example?

2016-09-13 Thread Jonathan Vanasco
does anyone have an example of using view_config's `wrapper` argument? i'm trying to see if it would work for a specific use-case, but I can't figure out how to use it correctly. i looked in the tests for inspiration, but there doesn't seem to be a test against it either. -- You received

Re: [pylons-discuss] Looking for a project based on Pyramid which gives JSON API to Oracle database.

2016-09-06 Thread Jonathan Vanasco
Just to clarify the above... there are a lot of incredibly lightweight "plug and play" projects in Falcon that simply expose a sqlalchemy database via json and a restful API. as an internal service that your existing & secured pyramid app can talk to, they may be a better option than

Re: [pylons-discuss] Looking for a project based on Pyramid which gives JSON API to Oracle database.

2016-09-05 Thread Jonathan Vanasco
Assuming that you simply want to create a json api to oracle as an internal service... there are many SqlAlchemy+Falcon projects out there too. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop

[pylons-discuss] Re: New Pyramid Celery integration implementation

2016-08-22 Thread Jonathan Vanasco
On Sunday, August 21, 2016 at 6:41:35 AM UTC-4, Mikko Ohtamaa wrote: > > > * Configured through INI settings > > * Kick off delayed task on transaction commit > > If there is market demand I might factor this out to a separate package > I think it would be GREAT if there were a separate

[pylons-discuss] Re: Authentication and authorisation package

2016-07-30 Thread Jonathan Vanasco
@steve thanks for the correction. sorry about the org/com confusion @others django's auth is way higher than pyramid's. it's hardcoded onto an orm based user-management system that defines different classes of objects and how they interact with one another. in addition to basic auth, it also

Re: [pylons-discuss] Authentication and authorisation package

2016-07-26 Thread Jonathan Vanasco
Django is a much higher-level framework than Pyramid. For a comparable Auth system, you would probably need to use one of the web frameworks built on top of Pyramid (see trypyramid.org) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To

[pylons-discuss] using Paste's proxy-prefix with inherited ini files?

2016-07-13 Thread Jonathan Vanasco
I'm cleaning up a deployment and ran into something that I don't quite understand. If I apply a `filter-with` in a base.ini file, I can't overwrite (or append) any values in a derivied.ini for example: base.ini [app:main] use = egg:MyApp foo = bar filter-with = proxy-prefix

Re: [pylons-discuss] Re: Seeking advice on direction with database connectivity from Pyramid

2016-07-13 Thread Jonathan Vanasco
On Wednesday, July 13, 2016 at 11:03:04 AM UTC-4, Niall wrote: > > If I'm understanding what you're both saying then the best approach may be > to abandon using my customized db wrapper and go back to using standard > sqlalchemy > Not really. I'm suggesting that it may be *quickest* to use

Re: [pylons-discuss] Re: Seeking advice on direction with database connectivity from Pyramid

2016-07-12 Thread Jonathan Vanasco
On Tuesday, July 12, 2016 at 1:11:30 AM UTC-4, Mike Orr wrote: 8. If you don't want to use the ORM, you can make a request property > that returns an engine or connection (#2, #3, #4, #5). I don't know > whether you could register that with Pyramid's transaction manager; > you'd probably have

[pylons-discuss] Re: Seeking advice on direction with database connectivity from Pyramid

2016-07-11 Thread Jonathan Vanasco
The easiest thing is to look how various integrations are done in the Pyramid scaffolds and some open source projects. The most popular approach is to create a connection pool that is available to all requests; and each request will create/manage/close a connection as-needed. The default

Re: [pylons-discuss] pserve: "No such file or directory --reload" (or any other option flag)

2016-06-23 Thread Jonathan Vanasco
On Thursday, June 23, 2016 at 5:10:46 PM UTC-4, Michael Merickel wrote: > > Something has likely become corrupt in your virtualenv. I'd try creating a > new one. This is not a but with the pserve code itself but rather your > environment. > This same thing has happened to me a few times when

[pylons-discuss] Re: Automatically pull from git and restart the pserve production.ini

2016-06-19 Thread Jonathan Vanasco
You can also do this with supervisord basically you configure supervisord to manage the pyramid process however you see fit (uwsgi, pserve, etc) then you write another script that listens for webhooks or polls for changes, and signals a restart fo supervisord to restart the pyramid process

[pylons-discuss] Re: anyone work on temporary values from expensive functions? (perhaps dogpile+celery)

2016-06-17 Thread Jonathan Vanasco
prototyping this was pretty quick. the only hard bit will be pulling out the correct pyramid settings data for celery (I hardcoded it for now) the general recipe is here: https://gist.github.com/jvanasco/f80f578c8632d489b721b2a254ee358e -- You received this message because you are

Re: [pylons-discuss] anyone work on temporary values from expensive functions? (perhaps dogpile+celery)

2016-06-17 Thread Jonathan Vanasco
On Friday, June 17, 2016 at 7:54:49 PM UTC-4, Vincent Catalano wrote: > > Taking a step back a bit, have you considered something like a > materialized view at the database level for your complex queries? > I *wish* I could use them for this use-case. Unfortunately I think that would cause

[pylons-discuss] anyone work on temporary values from expensive functions? (perhaps dogpile+celery)

2016-06-17 Thread Jonathan Vanasco
I've run into a peculiar issue on one of our systems. A handful of sql queries have become quite expensive [database growth]. Even with aggressive optimizations, some queries can take 45 seconds. [Migrating to a different database or hardware infrastructure is likely the only avenue for

Re: [pylons-discuss] strategies for conversion from json to SQLalchemy model layer?

2016-06-09 Thread Jonathan Vanasco
In our largest app we have a caching layer and do a lot of transitions between SqlAlchemy and a Dict (both directions) some of these may apply to you: 1. dicts are wrapped in an 'attribute safe' container, so they behave like sqlalchemy objects. certain sqlalchemy relationships are handled

Re: [pylons-discuss] testing advice sought - external callback/hook

2016-06-06 Thread Jonathan Vanasco
thanks so much! this worked based on your example!: def tearDown(self): if self.testapp_http is not None: self.testapp_http.shutdown() def test_foo(self): self.testapp_http = StopableWSGIServer.create(self.testapp.app) self.testapp_http.wait()

[pylons-discuss] testing advice sought - external callback/hook

2016-06-06 Thread Jonathan Vanasco
I'm open-sourcing a pyramid-based client for the LetsEncrypt https certificate service, and have run into an issue with the tests. All the tests are written using webtest, specifically TestApp. On one specific test, after stepping through a form, I need to receive a web request from the

[pylons-discuss] Re: how to get image file out of json body of request?

2016-05-26 Thread Jonathan Vanasco
On Thursday, May 26, 2016 at 3:02:47 AM UTC-4, Krishnakant wrote: > > first, how do I send a request containing JSON object having all the > form fields + a png or jpeg image? > option 1- have your ajax script submit a POST with the image in multipart file fields option 2 - have your ajax

[pylons-discuss] Re: Identity management in Pyramid

2016-05-22 Thread Jonathan Vanasco
Velruse lets you authenticate to 3rd parties https://velruse.readthedocs.io/en/latest/usage.html otherwise, it looks like you're describing the commercial janrain system -- cloud based accounts and you just authenticate into them. I once inherited a contract with them in the past, and found

Re: [pylons-discuss] has anyone audited/benchmarked the performance and memory footprint of the different view registration types against one another?

2016-05-10 Thread Jonathan Vanasco
On Tuesday, May 10, 2016 at 1:23:59 PM UTC-4, Bert JW Regeer wrote: > > There is no additional overhead between the two. > The `@view_config` decorator creates a wrapped function - which is the small hit to the memory footprint. The source shows the decorator registers + returns the

[pylons-discuss] has anyone audited/benchmarked the performance and memory footprint of the different view registration types against one another?

2016-05-10 Thread Jonathan Vanasco
I know that `@view_config` has an initial hit on startup, but I am interested in anyt overall performance differences. I set up a quick informal test with 200 routes/views, and the only noticeable difference was that using the `@view_config` decorator added (approximately) a 1MB overhead to

Re: [pylons-discuss] Data Model

2016-05-02 Thread Jonathan Vanasco
On Friday, April 29, 2016 at 1:11:25 AM UTC-4, golauty wrote: > > My data model would fetch data from a couple of sources via rest api, this > data would then be used by the views. > Ocassionaly(very rare) i want to push data to my model and finally do post > requests. > This strategy won't

Re: [pylons-discuss] How to fix request.client_addr

2016-04-29 Thread Jonathan Vanasco
On Thursday, April 28, 2016 at 9:47:50 PM UTC-4, Zsolt Ero wrote: > > Thanks, that's a great howto, unfortunately, I'd need to compile nginx > from sources to get that module. > Unless you don't have root access, compiling nginx from source is honestly the best way to deploy your server.

Re: [pylons-discuss] How to fix request.client_addr

2016-04-28 Thread Jonathan Vanasco
You can do this in nginx. Cloudflare publishes a list of trusted ips; the nginx set_real_ip module will only apply the real-ip header to those matching ips. https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx- you could do it in python,

Re: [pylons-discuss] Pyramid Debugtoolbar 3.0 released

2016-04-25 Thread Jonathan Vanasco
Thanks. Totally unaffected by this! On Monday, April 25, 2016 at 12:27:47 AM UTC-4, Bert JW Regeer wrote: > > > https://github.com/Pylons/pyramid_debugtoolbar/commit/e348868a2d5513b8c6b53b0853e830d66076d034 > >

[pylons-discuss] Re: Pyramid Debugtoolbar 3.0 released

2016-04-24 Thread Jonathan Vanasco
On Saturday, April 23, 2016 at 2:34:24 PM UTC-4, Michael Merickel wrote: - setuptools-git is now required to install a fork of the codebase in > non-editable mode. This is only for forks, not for the official version > from PyPI. > Is there a changeset related to this? I'm trying to see if

[pylons-discuss] Re: Recommendations regarding session factory?

2016-04-17 Thread Jonathan Vanasco
If you serve content via https, you may not need/want encrypted cookies. You can get free SSL certs trusted in most browsers from LetsEncrypt.org If your desire to encrypt the data is to keep the consumer from accessing the payload, it's not that hard to stuff an encrypted payload in the

Re: [pylons-discuss] disable logging with `prequest`?

2016-04-11 Thread Jonathan Vanasco
On Monday, April 11, 2016 at 12:50:12 PM UTC-4, Michael Merickel wrote: > > prequest --help says: > > The variable "environ['paste.command_request']" will be set to "True" > in > the request's WSGI environment, so your application can distinguish > these > calls from normal

Re: [pylons-discuss] disable logging with `prequest`?

2016-04-11 Thread Jonathan Vanasco
Thanks for the advice. I should have been more clear -- my intent isn't to turn off logging on a running application, it's to turn off logging on views invoked by prequest. I have a sideproject that doesn't necessarily need to be run via a web interface. a quick way to do "offline" work is to

Re: [pylons-discuss] What is the correct way to add an object to a request instance?

2016-03-24 Thread Jonathan Vanasco
I thought `set_property` and `add_request_method` also ensured what you're doing is "safe". -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[pylons-discuss] What is the correct way to add an object to a request instance?

2016-03-24 Thread Jonathan Vanasco
I need to add a non-callable object to a request instance which is more correct? request.foo = objInstance request.set_property(lambda x: objInstance, 'foo') usually i'd use add_request_method on the config, but this is for a single view -- You received this message because you

[pylons-discuss] what is the correct way to serve a non-file response with binary data?

2016-03-23 Thread Jonathan Vanasco
I have a small parcel of information that needs to be sent as binary data. (it's an openssl cert in der format). i can't figure out the right way to set up the response. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from

[pylons-discuss] Re: can I use requests for json calls in views

2016-03-19 Thread Jonathan Vanasco
I'm a little unclear on what you're trying to do, because 'session' and 'requests' are used do describe actions , objects and libraries. I'm reading this as possibly being pyramid interacts with a 3rd party API using the `requests` library? you want to run `requests` on some machine to

[pylons-discuss] Re: can I use requests for json calls in views

2016-03-19 Thread Jonathan Vanasco
>From what you're written, I think you've become confused by different Python projects that have similar names and APIs. In Pyramid, we have a "request" object in each view. Pyramid's "request" is a subclass of WebOb (http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/webob.html).

Re: [pylons-discuss] Stripe payments with Pyramid

2016-03-15 Thread Jonathan Vanasco
Just a word of caution to Vincent's method... I strongly suggest that you fork from github and install off your personal fork. If the original maintainer's version disappears (that has happened to me), you'll spend way too much time tracking down a compatible version (if you can find one) or

[pylons-discuss] Re: Tuning the number of waitress threads for production

2016-03-11 Thread Jonathan Vanasco
> My theory is that if the threads get tied up with a few slow requests, the server can no longer service the faster ones. That's usually the issue. It's compounded more when you don't pipe things through something nginx, which can block resources on slow/dropped connections. A few ideas

Re: [pylons-discuss] Can I subscribe to an "Exception" event?

2016-03-10 Thread Jonathan Vanasco
On Thursday, March 10, 2016 at 2:34:56 AM UTC-5, Michael Merickel wrote: > > There is no event emitted by Pyramid upon exception right now. You could > emit it yourself by adding a tween UNDER the excview tween that would catch > exceptions, notify subscribers, and then re-raise the exception

Re: [pylons-discuss] beaker and google(or others') bot

2016-03-02 Thread Jonathan Vanasco
I'm not suggesting that. I'm suggesting that packages adopt a standard hook to detect bots and invoke an alternate session. Otherwise, a custom SessionFactory is needed and the convenience methods that create the various session factories from the environment configs are unusable. Thats fine

Re: [pylons-discuss] beaker and google(or others') bot

2016-03-02 Thread Jonathan Vanasco
On Wednesday, March 2, 2016 at 1:46:06 PM UTC-5, Bert JW Regeer wrote: > > There already is a hook. The session factory. > That's a hook in Pyramid. I mean that packages like pyramid_beaker, pyramid_redis_sessions, etc should have a standard hook to support alternate sessions for bots. I

Re: [pylons-discuss] Re: beaker and google(or others') bot

2016-03-02 Thread Jonathan Vanasco
On Monday, February 29, 2016 at 8:44:28 AM UTC-5, tonthon wrote: > > Thanks for your response. Switching the session type is effectively a > solution. > I'll give it a try. > The more I think about this, the more I think there should be a standard hook on backend session factories for

Re: [pylons-discuss] Best place/time to process .ini variables for application constants

2016-03-02 Thread Jonathan Vanasco
On Wednesday, March 2, 2016 at 12:24:34 AM UTC-5, Bert JW Regeer wrote: > > How about before returning config.make_wsgi_app() you do the work, stuff > it into config.registry.settings, then add a new request method on request > that you call with: > > request.get_data() > > that simply pulls

Re: [pylons-discuss] Best place/time to process .ini variables for application constants

2016-03-01 Thread Jonathan Vanasco
thanks for the quick response. `reify` isn't applicable. this bit runs once every request... but on every request. I know this won't really have any noticeable affect, but I feel guilty running 25-30 operations on every request that could just be done once. -- You received this message

[pylons-discuss] Best place/time to process .ini variables for application constants

2016-03-01 Thread Jonathan Vanasco
I have a bit of code that generates a few lists based on data in the active `.ini` These lists will never change for the lifetime of the process. Right now I'm just hitting request.registry.settings on every request - but this just makes me feel like I'm being lazy. Is there a good place to

[pylons-discuss] Re: beaker and google(or others') bot

2016-02-26 Thread Jonathan Vanasco
A way that would work, is to use a custom SessionFactory. The SessionFactory in called with the `request` object on first invocation, so you can use that to decide on which type of session you want.

[pylons-discuss] Re: pyramid + mongodb +cornice ?

2016-02-24 Thread Jonathan Vanasco
Use the cornice template. cornice is the more 'in depth' project and has more particular application design requirements pyramid_mongodb hasn't been touched in a few years. the template is basically just for the demo. all the logic is in the `__init__.py` which has a subscriber that reads

[pylons-discuss] uwsgi + pyramid - SIGPIPE/IOError on 404?

2016-02-12 Thread Jonathan Vanasco
I was checking logs, and I noticed some odd behavior on a 404. uwsgi/pyramid was listing a SIGPIPE + IOError This was on an earlier version of uwsgi (1.9.14). I upgraded to latest and everything works as it should. I'd just like to make sure I'm not missing anything. Has anyone experienced

Re: [pylons-discuss] How to use Single Sign-On (SSO) with pyramid

2016-02-10 Thread Jonathan Vanasco
On Wednesday, February 10, 2016 at 12:00:27 PM UTC-5, Arndt Droullier wrote: > > And make sure it is not OpenAuth or OpenID; unlike SSO in general there > are a few python client libs ready to use. > Assuming OpenAuth means oAuth, this low-level package is pretty great -

[pylons-discuss] Re: Problems with debug toolbar when running via uwsgi

2016-01-21 Thread Jonathan Vanasco
On Thursday, January 21, 2016 at 3:57:30 AM UTC-5, Achim Domma wrote: > > we have a problem with the debug toolbar. It is working fine, when the > application is run via pserve on local development machines. When running > the application using uwsgi, the debug toolbar fails quite often. Or

[pylons-discuss] Re: Pyramid + uwsgi auto reload on source change

2016-01-15 Thread Jonathan Vanasco
On Thursday, January 14, 2016 at 6:55:10 PM UTC-5, Srikanth Bemineni wrote: > > from uwsgidecorators import postfork > > This is needed for initiating my cassandra connections on forking. > uwsgidecorator imports uwsgi, which will be only available when I run using > uwsgi. So when I start

Re: [pylons-discuss] Re: A little something that I wrote in Dec

2016-01-14 Thread Jonathan Vanasco
On Thursday, January 14, 2016 at 2:08:32 AM UTC-5, Rach Belaid wrote: > > Hi Jonathan, > > I'm quite disappointed by Goose but I knew it already. I planning to add > support for libextract as diffbot is too for my usecase. > That makes me happy! We use two libraries. One is what I

[pylons-discuss] Re: Pyramid + uwsgi auto reload on source change

2016-01-12 Thread Jonathan Vanasco
On Tuesday, January 12, 2016 at 1:22:24 PM UTC-5, Jason wrote: This doesn't answer your question, but I would recommend using pserve and > waitress for development. > We use nginx>uwsgi in production and nginx>pserve in development. By keeping nginx consistent, it really minimized the

<    1   2   3   4   5   6   7   8   9   10   >