Re: [pylons-discuss] Dynamically-generated PDF to download

2015-01-26 Thread Jonathan Vanasco
Just want to give a quick warning that a lot of the pdf libraries use crazy amounts of memory. I have no experience with pdfkit, and it may behave differently. If it causes issues with memory/performance, I usually handle this stuff in Pyramid one of two ways: a- I segment out the PDF

[pylons-discuss] Re: Verifying user password

2015-01-13 Thread Jonathan Vanasco
I'd be interested to know how you eventually achieve this, so please post an update! I ran into the same problem a few years ago, and the Auth docs weren't really written yet... so I just ditched Pyramid's Auth system and we built our own. -- You received this message because you are

[pylons-discuss] Re: pyramid session managment

2015-01-12 Thread Jonathan Vanasco
i've never seen pyramid-kvs before. pyramid_redis_sessions is actively discussed here, is recommended in the docs, and has contributions by at least one of the core pyramid developers. pyramid_kvs may be better for a variety of reasons, but i'd be more inclined to select pyramid_redis_sessions

Re: [pylons-discuss] Re: Finding a session

2014-12-24 Thread Jonathan Vanasco
On Wednesday, December 24, 2014 1:52:53 PM UTC-5, Mike Orr wrote: I think I misunderstood what you meant. You mean to display the current session (in which case it can pull it from 'request.session' without knowing the session ID)? I do do that in some applications, and that may be the

[pylons-discuss] Re: Finding a session

2014-12-23 Thread Jonathan Vanasco
Yeah, it's because the cookievalue is signed: https://github.com/ericrasmussen/pyramid_redis_sessions/blob/master/pyramid_redis_sessions/__init__.py Using the pyramid functions by default, which serializes to b64:

Re: [pylons-discuss] Re: Finding a session

2014-12-23 Thread Jonathan Vanasco
On Tuesday, December 23, 2014 4:56:15 PM UTC-5, Mike Orr wrote: Works. I'll just need to write a script to dump the session. I like do to things like this in behind a /admin page, this way I can see everything in real time (and use pprrint) -- You received this message because you are

[pylons-discuss] Re: Same mailer instance being returned regardless of which request is passed to get_mailer

2014-12-22 Thread Jonathan Vanasco
On Monday, December 22, 2014 3:40:11 PM UTC-5, Tres Seaver wrote: The mailer is a utility (a singleton), registered in 'request.registry'. Just to expand on this answer a bit... The mailer is designed to be configured-for and associated-with the scope of an application -- not each

Re: [pylons-discuss] Upgraded Pyramid and other modules, now tracebacks are broken

2014-12-15 Thread Jonathan Vanasco
I've never used Pyramid under windows, so I could be off here... But when running under Mac/Linux, one can trip 500x error that just says Invalid Request (or similar) under a few scenarios: • exceptions in the wsgi middleware stack • exceptions in most areas of the debugtoolbar code •

[pylons-discuss] Re: deciding on pyramid vs ruby

2014-12-09 Thread Jonathan Vanasco
I'll preface this by saying that I'm biased towards Pyramid, and when I have to program - I prefer it. I begrudgingly program though - I'm usually on the business/product/management side. But in the past 3 years: I've been working extensively with Pyramid on a personal project, was CTO of a

Re: [pylons-discuss] pyramid - building plug-ins?

2014-12-08 Thread Jonathan Vanasco
To phrase things slightly differently: Wordpress is a fairly high-level Web Application that has a rigid internal API that deals with Admin Consumer views, requires a singular database connection (mysql), and offers a plugins and theming architecture. Plugins interact with the internal API

Re: [pylons-discuss] Re: webassets or fanstatic?

2014-11-12 Thread Jonathan Vanasco
Yes with www. But of course it can also be a different domain. Great! Some people just don't realize that. Glad you do. If you're really worried about theoretical optimal speeds, the approach I like is to use getting a dedicated domain that is 4-5 characters on a 2 letter extension (i.e.

Re: [pylons-discuss] Re: webassets or fanstatic?

2014-11-11 Thread Jonathan Vanasco
On Tuesday, November 11, 2014 3:03:52 PM UTC-5, Marc Rijken wrote: In my situation the CDN is behind a different domain name as the main site: cdn.example.com vs www.example.com. In bowerstatic you can define that the statics assets will have a different base than the regular pages.

[pylons-discuss] announcement - pyramid_debugtoolbar_dogpile

2014-11-05 Thread Jonathan Vanasco
I cleaned up some code used to monitor dogpile caching through the debugtoolbar the package works by wrapping api calls to a dogpile cache region, and logging their performance (timing, hit/miss, key, etc) statistics and raw data are both shown in the debugtoolbar, with everything colorcoded

Re: [pylons-discuss] Is the pyramid tutorial missing a step?

2014-11-01 Thread Jonathan Vanasco
that is a perfect commit message! -- 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 post to this group, send email

[pylons-discuss] Re: Strange overlaps in independent Pyramid projects

2014-10-31 Thread Jonathan Vanasco
Re: SqlAlchemy The first thing I do with problems like this, is to remove every single .pyc and .pyo file in my projects' directory tree. 9/10 times, the problem is that I changed the some imports and old .pyc files are being picked up. one way this can affect you is in this example: if you

Re: [pylons-discuss] Is the pyramid tutorial missing a step?

2014-10-31 Thread Jonathan Vanasco
I jut got confused on that too, because I read it too fast. It might be more clear if the line: The steps each correspond to a directory in this repo, where each step/topic/directory is a Python package. was in it's own paragraph. -- You received this message because you are subscribed to

Re: [pylons-discuss] creating an object from multiple input sources

2014-10-24 Thread Jonathan Vanasco
A slight variant is to dispatch on the init: class MyThing(object): def __init__(self, **kwarg): s = kwarg['source']: if s == 'db': self._init_db(**kwarg) elif s == 'json': self._init_sson(**kwarg) else: raise ValueError(invalid source) def _init_db(self, **kwarg): pass def _init_json(self,

[pylons-discuss] Re: passing a context object to css

2014-10-21 Thread Jonathan Vanasco
You have 3 options: 1. Generate the CSS in your main template (in a style section) 2. Generate the CSS as a dynamic file 3. Use a static CSS file, and generate CSS overrides in the main template (in a style section) I prefer option 3. -- You received this message because you are subscribed

[pylons-discuss] debugtoolbar plugin: replay ajax requests - pyramid_debugtoolbar_ajax

2014-10-21 Thread Jonathan Vanasco
A while back I had a lot of issues debugging Ajax requests, as the toolbar only shows the passive request data. I had to manually recreate the url (using a mix of web browser devtools and custom logging) and paste it into a new browser window to get to the active tools that the debugtoolbar

[pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
i'm using url dispatch , and I have some routes that begin with this: /by/{username:\w+} i now need to support 'id' based urls as well. e.g. /by/{userid:\-\d+} the regexes are actually more complicated, and defined elsewhere. there is an approach i think I'd like to pursue, and

Re: [pylons-discuss] strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
Thanks! It looks like Route Factory is what I want. The docs are pretty sparse on it (at least on http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/urldispatch.html) I'll look up some examples in public Pyramid projects and blogs later. I didn't realize that I could affect the dict

[pylons-discuss] Re: strategies for multiple similar routes to a single view

2014-10-15 Thread Jonathan Vanasco
wow. thanks. that is a much cleaner explanation than the docs. converting to a factory was ridiculously simple! -- 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

[pylons-discuss] Re: place views and add_route nearby but in different module

2014-10-10 Thread Jonathan Vanasco
I recommend that you don't do this. It sounds convenient now, but as your project or package matures, you will end up creating an unmaintainable mess. The big benefit of having declaring all the routes together, is that you have a single chunk of code that maps every single route -- and lets

[pylons-discuss] logging confusion

2014-10-10 Thread Jonathan Vanasco
I'm having two issues with logging on production. Hoping someone can point out my mistake First- My production.ini has the root logger set to WARNING [logger_root] level = WARNING handlers = console One (unconfigured) package would often end up logging at the DEBUG level with

[pylons-discuss] Re: pyramid and cassandra. How to glue them together?

2014-10-08 Thread Jonathan Vanasco
I don't have an exact answer, but I can give you a starting point - It's my understanding that with the datastax driver/api, there is a large initial connection hit, and most people want to re-use the same same Session across multiple requests to minimize that. It looks like a popular

[pylons-discuss] disabling transaction's logging in debugtoolbar ?

2014-10-06 Thread Jonathan Vanasco
The `new transaction` + `commit` messages for every debugtoolbar hit were starting to be too much noise on my dev environment. (every 5 seconds or so, an ajax request is made by the toolbar) i couldn't find a good way to suppress them within the debugtoolbar itself, so ended up just dropping

Re: [pylons-discuss] Re: Pyramid models - can't understand the logic - noob

2014-09-25 Thread Jonathan Vanasco
On Thursday, September 25, 2014 1:21:33 PM UTC-4, tonthon wrote: 1- Use something like sqlautocode to dynamically build models regarding your existing database structure 2- Migrate tables to fit your declared models 3- Delete your tables You'll use 1 and 2 if you'd like to keep the

[pylons-discuss] Re: Pyramid models - can't understand the logic - noob

2014-09-24 Thread Jonathan Vanasco
most of these questions are more SqlAlchemy oriented, not about pyramid. the initialize_db stuff is only needed when you're creating a database from scratch. many people don't do that. there are a handful of SqlAlchemy oriented projects on PyPi that will build a declarative based models.py

[pylons-discuss] Re: Global variables when using gunicorn

2014-09-09 Thread Jonathan Vanasco
Try searching shared memory gunicorn While gunicorn doesn't support shared memory, there are a lot of workarounds on various lists and stack overflow to solve your exact need. Most of them seem indexed under the shared memory concept. -- You received this message because you are subscribed

[pylons-discuss] Re: How to downgrade a particular package?

2014-09-08 Thread Jonathan Vanasco
commandline $ pip install pyramid_mailer==4.1 setup.py: install_requires = ['pyramid_mailer ==4.1'] -- 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] Re: RFC: Pyramid tutorial at PyCon

2014-09-04 Thread Jonathan Vanasco
On Thursday, September 4, 2014 6:35:36 AM UTC-4, Paul Everitt wrote: Lately I've been doing a lot of frontend development: AngularJS talking to a REST API in Pyramid. Which also means the modern frontend toolchain: npm, bower, grunt/gulp, with Karma/Protractor for testing. Do you think I

[pylons-discuss] Re: RFC: Pyramid tutorial at PyCon

2014-09-04 Thread Jonathan Vanasco
A better way to state what I meant to say: I think the more attractive proposals offer a few things: • They're not just concerned with HOW to use something, but WHY people should use it • They show people how to do something the right way or a better way than they currently handle • They

Re: [pylons-discuss] is there any video tutorials available

2014-08-18 Thread Jonathan Vanasco
There are also a bunch on the PyCon Video Archive: http://pyvideo.org/search?models=videos.videoq=pyramid -- 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] Re: pyramid_redis_sessions and alternate serializers

2014-07-31 Thread Jonathan Vanasco
it's late and i'm still in the office, so here's some probably bad ideas that might help until someone can answer tomorrow from similar experience. My question is, can I get it to just store a native Redis hash? I don't know this package at all but I spent a lot of time with `dogpile` and

[pylons-discuss] Re: Per user connection using SQLAlchemy ORM

2014-07-30 Thread Jonathan Vanasco
On Tuesday, July 29, 2014 6:59:05 PM UTC-4, Laurence Rowe wrote: If you are only interested in using the database roles for authorization rather than authentication then you could switch role at the beginning of the transaction so you don't have to deal with custom connection pooling,

Re: [pylons-discuss] Re: Per user connection using SQLAlchemy ORM

2014-07-25 Thread Jonathan Vanasco
I have a bit of non-pyramid/sqlalchemy insight / warnings for this: with this design pattern, you're going to need to pay close attention to the database server setup, and (probably) either disable connection pooling or create some sort of management for it. depending on usage, you have the

[pylons-discuss] Re: get_current_request() for debug output / logging?

2014-07-21 Thread Jonathan Vanasco
The docs would suggest that you're fine for this use case http://docs.pylonsproject.org/projects/pyramid/en/latest/api/threadlocal.html?highlight=get_current_request#pyramid.threadlocal.get_current_request This function should be used extremely sparingly, usually only in unit

Re: [pylons-discuss] How does one use SQLAlchemy Events with Pyramid?

2014-07-14 Thread Jonathan Vanasco
You can just use the SqlAlchemy events as in the examples in the SqlAlchemy docs. If you need to access the current request, you can use Pyramid's `get_current_request`, which is rather lightweight. Just a quick bit of forewarning / pIanning -- t's usually best to keep the pyramid code

[pylons-discuss] Re: Pyramid + Ajax Views

2014-07-14 Thread Jonathan Vanasco
As far as pyramid is concerned, all you really need is something like this: class ClassBasedView(BaseObject): @view_config( route_name=order_json_api, renderer=json) def order_json_api(self): custom_json_data = json_data( self.request ) ## returns a dict return custom_json_data You can

[pylons-discuss] Re: How does one use SQLAlchemy Events with Pyramid?

2014-07-14 Thread Jonathan Vanasco
This works under Pyramid for me -- https://gist.github.com/jvanasco/17e1118b3f04dee75353 IIRC before|after update triggers within the context of a flush ( either explicit or part of a commit ) and the SQL for a class actually being emitted. Is it possible that you're not calling

Re: [pylons-discuss] What similar on Django-collectstatic for Pyramid?

2014-07-10 Thread Jonathan Vanasco
Torsten-- Thanks for the tip! I had no idea about Invoke, and I immediately noticed that it's written by the developer who maintains Fabric. Then I read this page about Invoke + Fabric 2.x http://www.fabfile.org/roadmap.html -- You received this message because you are subscribed to the

Re: [pylons-discuss] What similar on Django-collectstatic for Pyramid?

2014-07-09 Thread Jonathan Vanasco
On Tuesday, July 8, 2014 1:51:04 PM UTC-4, Michael Merickel wrote: In my own software there is a build step in our deployment pipeline that aggregates these assets. This pipeline however has nothing to do with pyramid or python. There's just a bash script that knows to move the assets

Re: [pylons-discuss] Best practice of when to use view callable classes instead of functions?

2014-07-09 Thread Jonathan Vanasco
On Tuesday, July 8, 2014 10:19:31 AM UTC-4, Paul Everitt wrote: 1) Visually grouping related views. Let's say you have a BlogEntry. It has a few views. I personally like having a BlogEntryView view class to group them together. Just an aesthetic point. We typically use class methods

Re: [pylons-discuss] What is the best practice to protect GET request against CSRF attacks?

2014-07-08 Thread Jonathan Vanasco
If you have expensive calculations, you can just lock them down onto a POST page under HTTPS with a CSRF token. That will eliminate most issues. You can also segment expensive routes to run in their own application instance , and throttle users (based on session, ip, etc ) so that general

[pylons-discuss] Re: http://www.pylonshq.com down!?

2014-07-08 Thread Jonathan Vanasco
I don't think pylonshq is used anymore. Those links should probably be fixed. I'll file a ticket. You might be able to just remove these 2 lines from setup.cfg: [easy_install] find_links = http://www.pylonshq.com/download/ You can grab most (all?) of the packages from

[pylons-discuss] Re: New event/callback after_view inside tween ?

2014-06-27 Thread Jonathan Vanasco
I just wanted to pull all these links together into this thread for reference:: There's already a bit of discussion on that: * https://github.com/Pylons/pyramid/issues/1336 This seems to be a tangent to another discussion (which you started!) here : *

Re: [pylons-discuss] Using ZODB from Response.app_iter

2014-06-15 Thread Jonathan Vanasco
If your result-set is small, have you considered tempfile.SpooledTemporaryFile - or slurping the entire DB record from the database within the view? -- 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: Database connection (to cassandra) times out in a view function, but works in __init__.py

2014-06-12 Thread Jonathan Vanasco
fwiw, uwsgi has a `post_fork_hook` that might be useful for you. in order to use pycrypto on uswgi , you have to do something like this in pyramid: import uwsgi from Crypto.Random import atfork def post_fork_hook(): atfork()

[pylons-discuss] Re: Integrating Schedular with Pyramid

2014-06-02 Thread Jonathan Vanasco
You can use Command Line Pyramid for this. http://docs.pylonsproject.org/docs/pyramid/en/latest/narr/commandline.html 1. Create a Python script that loads the pyramid API and bootstraps a request object. 2. Do whatever you want. 3. Trigger the script with whatever scheduling software you

[pylons-discuss] does anyone know if pyramid is safe to use with Python's optimization flag ?

2014-05-30 Thread Jonathan Vanasco
among the various optimizations, -O / PYTHONOPTIMIZE will strip out `assert` statements i came across 4 assert statements in the pyramid core; they just looked to be runtime checks everything seems to run fine... and I'm getting around a 20% performance bump on speed so far just wanted to

[pylons-discuss] Re: DBSession multi-tenant question

2014-05-23 Thread Jonathan Vanasco
since you're using sqlalchemy, you could use a pyramid subscriber to configure the session / engine... and use one of sqlalchemy's hooks to automatically filter for you. https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/PreFilteredQuery

Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Jonathan Vanasco
On Monday, May 19, 2014 7:06:20 PM UTC-4, Randall Leeds wrote: http://docs.pylonsproject.org/projects/pyramid/en/master/narr/renderers.html#using-the-add-adapter-method-of-a-custom-json-renderer FWIW, I found it more beneficial to use a custom JSON serializer and make it available via a

Re: [pylons-discuss] Re: TypeError: ObjectId() is not JSON serializable

2014-05-19 Thread Jonathan Vanasco
long day... i meant that at some point you may be using a variety of scripts/apps that somehow interact with your project (celery, twisted, etc). If you rely on the pyramid rendering framework for this, you essentially become dependent on Pyramid for this. If you have a standalone package

Re: [pylons-discuss] How to store session data server side?

2014-05-09 Thread Jonathan Vanasco
On Thursday, May 8, 2014 8:08:37 PM UTC-4, Chris McDonough wrote: On 05/08/2014 04:42 PM, Jonathan Vanasco wrote: I understand this to mean (from your earlier emails, you don't expressly say it above) that you want to be sure that there is a existing session that has the id 123 if you

Re: [pylons-discuss] How to store session data server side?

2014-05-08 Thread Jonathan Vanasco
On Thursday, May 8, 2014 7:16:43 AM UTC-4, Chris McDonough wrote: All of the above use cases presume that you have visibility into the session implementation's backend to load data. If you do, that's fine, but there are no APIs in Pyramid that provide this functionality, so you're

Re: [pylons-discuss] How to store session data server side?

2014-05-08 Thread Jonathan Vanasco
On Thursday, May 8, 2014 1:40:58 PM UTC-4, Chris McDonough wrote: I'd be surprised. That'd presume the two implementations stored data in the exact same way, which might well be the case, but can't be assumed. If it didn't break, it'd only be by happy accident. agreed. most just

Re: [pylons-discuss] Workaround for forward slashes in URL

2014-05-08 Thread Jonathan Vanasco
I don't think this is doable. if you have this route accept slashes /{base_id}/{sub_id_with_slashes} than how do you differentiate these 2 routes ? /{base_id}/{sub_id_with_slashes} /{base_id}/{sub_id_with_slashes}/{some_text} this url would match both patterns :

Re: [pylons-discuss] How to store session data server side?

2014-05-07 Thread Jonathan Vanasco
which is why I keep badgering him to weigh in on this issue only. sorry, i feel a bit clearer on what you want to hear now. for this particular need, the others tabled, it's largely testing and troubleshooting -- and it is a bit more advanced. things we've used that key for in the past

Re: [pylons-discuss] order of events/callbacks/tweens

2014-05-06 Thread Jonathan Vanasco
This doesn't make much sense to me. Wouldn't there be much more utility to have the response_callback AFTER the response is created, this way it can operate on the response object? I did some digging in the source, and came across this change:

Re: [pylons-discuss] How to store session data server side?

2014-05-05 Thread Jonathan Vanasco
On Saturday, May 3, 2014 7:02:46 AM UTC-4, Chris McDonough wrote: Sure. It's always a tradeoff, though. If we over-specify the session interface, it makes session implementers' lives harder, and may reduce flexibility for consumers. I agree there is a tradeoff, but I don't see how

Re: [pylons-discuss] How to store session data server side?

2014-05-02 Thread Jonathan Vanasco
On Wednesday, April 30, 2014 4:28:49 PM UTC-4, Chris McDonough wrote: By the way, thank you for keeping up with this discussion, I know debating about things with folks who don't share your point of view can get pretty boring and frustrating. Thanks, and right back at you on both

Re: [pylons-discuss] advice sought on 'BeforeRender' and 'render' edge case.

2014-05-01 Thread Jonathan Vanasco
On Thursday, May 1, 2014 12:52:17 AM UTC-4, Michael Merickel wrote: It sounds like you'll be interested in subscriber predicates. http://docs.pylonsproject.org/projects/pyramid/en/1.5-branch/narr/hooks.html#subscriber-predicates Personally I send emails from message queue in a separate

Re: [pylons-discuss] advice sought on 'BeforeRender' and 'render' edge case.

2014-05-01 Thread Jonathan Vanasco
Understood. We use PostgreSQL as the default messaging queue for development configurations. Less moving parts than also running Redis (which is in production / staging and what the backend devs and contractors use locally). It works, but I wouldn't want to put it into production. Our

Re: [pylons-discuss] advice sought on 'BeforeRender' and 'render' edge case.

2014-05-01 Thread Jonathan Vanasco
i need to ship, so am cutting a corner. I came up with this quick snippet to provide eventless rendering until there's time for a proper solution. it just loops together the `render()` and `RendererHelper.render()` functionality. https://gist.github.com/jvanasco/e39fe984015a25e9aa33 --

Re: [pylons-discuss] How to store session data server side?

2014-04-30 Thread Jonathan Vanasco
The focus of this discussion shouldn't be the merits, drawbacks, or implementation details of server-side sessions vs client-side sessions -- which everyone is quick to chime in on. We can talk about that all day. We have, many times.. My concern isn't that there is a session_id variable in

[pylons-discuss] making the current request available in a debugtoolbar template

2014-04-30 Thread Jonathan Vanasco
Does anyone have a recommendation for making the current request (for the debugtoolbar itself) available to custom panel templates ? i just realized that the request which is passed along is the original request -- not the request for the debugtoolbar panel. i tried passing into a template

[pylons-discuss] Re: making the current request available in a debugtoolbar template

2014-04-30 Thread Jonathan Vanasco
oh! so the panel is generated during the first request (__init__) and attached to the history; then looked up and rendered in the toolbar views ? -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from this group and stop

Re: [pylons-discuss] Re: making the current request available in a debugtoolbar template

2014-04-30 Thread Jonathan Vanasco
this entire package makes so much more sense now. wow. -- 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 post to

[pylons-discuss] advice sought on 'BeforeRender' and 'render' edge case.

2014-04-30 Thread Jonathan Vanasco
We've run into an annoying edge-case with our use of BeforeRender. Our app utilizes BeforeRender to optimize priming/loading our object cache and data standardization. It's awesome and works great. We recently noticed some odd bugs and a general slowness from caches that weren't primed

[pylons-discuss] Re: Delegating to an external Pyramid/Pylons application

2014-04-29 Thread Jonathan Vanasco
A few thoughts, no answers or suggestions (other than the first ) - if you need to do internal requests, use `requests`. `urllib` is the devil. - if this is just a handful of views, I would probably have Pyramid1 set an auth-token, either as a cookie a get argument, and redirect to Pyramid2.

Re: [pylons-discuss] How to store session data server side?

2014-04-29 Thread Jonathan Vanasco
On Monday, April 28, 2014 11:46:22 PM UTC-4, Bert JW Regeer wrote: What are you using the session ID for? Performance logging (session_id into statsd and logs). Unit Testing. Integrated Testing. Automated Test suites. Development Troubleshooting ; Production Customer support. Often times

Re: [pylons-discuss] How to store session data server side?

2014-04-28 Thread Jonathan Vanasco
1. Like I mentioned above, but not very clearly, the big reason why I dislike the pyramid_session_[foo] approach, is that the only standardization is how it adapts to the ISession interface. There's no standardization on the (de)serialization interface. With the Beaker model, almost

Re: [pylons-discuss] How to store session data server side?

2014-04-28 Thread Jonathan Vanasco
On Monday, April 28, 2014 1:11:17 PM UTC-4, Chris McDonough wrote: As the class docstring indicates, the only contstraints on keys and values are that they must be pickleable. If some sessioning implementation does not provide this feature, it doesn't meet the ISession interface (which

Re: [pylons-discuss] How to store session data server side?

2014-04-24 Thread Jonathan Vanasco
FWIW, I handle my user interactions like this: there's a 'normal' pyramid beaker session on http sessions used to maintain login state and display data. ( request.session ) there's a secondary https only session , provided by a quick library i put together ( request.session_https )

[pylons-discuss] Re: How to get my projects' abspath?

2014-04-24 Thread Jonathan Vanasco
i keep the log files on the actual root in /var/log/MyApp . they can get large , and that is on it's own partition ( so nothing dies if the logs don't rotate by accident ) -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from

[pylons-discuss] Re: How to store session data server side?

2014-04-23 Thread Jonathan Vanasco
You can still use pyramid_beaker. It works fine under pyramid 1.5 . There are a few heated discussions in the archives over it. It's a sore point for many. I could be wrong on this, but last I checked it's not so much deprecated as it is off the radar.A lot of us still use it for

Re: [pylons-discuss] Re: How to store session data server side?

2014-04-23 Thread Jonathan Vanasco
On Wednesday, April 23, 2014 12:56:11 PM UTC-4, Chris McDonough wrote: Right, it's just not maintained. If someone wants to maintain it, they're free to pick it up. I wrote the original bindings but I can't/won't maintain it anymore. The Beaker code itself has no current maintainer,

Re: [pylons-discuss] Re: How to store session data server side?

2014-04-23 Thread Jonathan Vanasco
On Wednesday, April 23, 2014 2:23:03 PM UTC-4, Chris Rossi wrote: sudo apt-get install redis-server is pretty easy. Then you have a service on localhost listening to the default port, there's pretty much zero configuration required. It's a breeze to run and manage for sure; especially

Re: [pylons-discuss] Possible to know if a reified method was called ?

2014-04-17 Thread Jonathan Vanasco
i'm not sure if this holds true in zodb. but if you're using SqlAlchemy and didn't do any actual database work, calling `commit()` has no perceptible effect. sqlalchemy doesn't actually talk/connect to the database until you do the first query in a session. in practice... 1. you

[pylons-discuss] Re: DBSession and testing - transaction per test

2014-04-08 Thread Jonathan Vanasco
I never came into a good unit-test strategy for non-full stack operations. I do have a workaround. I ended up using a bootstrapped command-line pyramid script. That starts up and manages a Request for me. I don't use pyramid_tm for database yet, so am a little unsure of this... but... I

Re: [pylons-discuss] are there any stable ways to access or recreate the underlying mako environment ?

2014-04-04 Thread Jonathan Vanasco
oh sweet. thanks. for some reason, i didn't think of looking at the pyramid_mako docs. I went through pyramid docs, and the the pyramid+pyramid_mako source, but not the pyramid_mako docs. sigh. On Thursday, April 3, 2014 9:06:51 PM UTC-4, Michael Merickel wrote: pyramid_mako has the

[pylons-discuss] are there any stable ways to access or recreate the underlying mako environment ?

2014-04-03 Thread Jonathan Vanasco
I've run into a situation where I have some application code in a .mako file as a 'def' statement. this filefunction is used by several other templates. i've come into the situation where I now also need to render this def directly. i can handle that in the Mako API itself using something

Re: [pylons-discuss] Re: [SqlAlchemy] how to return a primary key in scoped session?

2014-04-02 Thread Jonathan Vanasco
What do you mean by Auto Commit ? 1) SqlAlchemy has an auto-commit mode. That means you do not wrap statements in transactions, and data is directly written to the tables. You would still need to call a flush() for SqlAlchemy to talk to the database though. SqlAlchemy will not talk to the

[pylons-discuss] Re: [SqlAlchemy] how to return a primary key in scoped session?

2014-04-01 Thread Jonathan Vanasco
Assuming this is SqlAlchemy, your only option is to call flush(). `flush()` simply tells the session to talk to the database. if you don't call `flush()` or `commit()`, SqlAlchemy doesn't talk to the database, and has no way of obtaining an id. i think requiring an explicit command to talk to

Re: [pylons-discuss] Starting Background Thread with zodb

2014-03-18 Thread Jonathan Vanasco
I'll second using Celery. I use it for the exact same things - Pyramid is used to handle the request(s) and ask for some work to be completed. Celery is used to handle the work. I don't like the idea of forking new work off Pyramid. Pyramid is your web server. You should really have it

Re: [pylons-discuss] Re: Pyramid + Video Games = ❤

2014-03-16 Thread Jonathan Vanasco
Cool. I'm really interested in how you're deploying and scaling pyramid , and hope you'll be able to share some of that. -- 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

Re: [pylons-discuss] Pyramid + Video Games = ❤

2014-03-13 Thread Jonathan Vanasco
Can you share any details about how you are deploying it? ( number of servers, uwsgi vs gunicorn vs others ) ? -- 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] Re: webassets or fanstatic?

2014-03-12 Thread Jonathan Vanasco
After struggling with a decision for a while, I ended up just using fabric and building this into our deployment routine. Our pyramid app toggles different includes between Production and Testing (based on environment.ini variables): - production * uses compressed / minified / joined /

Re: [pylons-discuss] pyramid and asynchronous programming

2014-03-09 Thread Jonathan Vanasco
We've been building a fairly large system for the past 2 years. Hopefully going into public beta soon. It deals with a lot of the same concepts as you're talking about. We've got a website, a twisted daemon and a celery daemon. The big tip I can give you is to consider how much you'd like

[pylons-discuss] Re: best vaguely Pyramid compatible static site generators?

2014-03-07 Thread Jonathan Vanasco
It wouldn't be too hard to use Pyramid as-is, then just have a pyramid command-line script that can loop through everything and build out the site for you. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To unsubscribe from this group and

Re: [pylons-discuss] bootstrap and forms in tabs ?

2014-03-05 Thread Jonathan Vanasco
The only way to affect the # on an invalid form submission would be with Javascript -- which means that I'd have to stash the 'active-pane' somewhere on the request object ( to render in the template ). I could , potentially, post to 'http://path/to/submit#active-tab' -- and not necessarily

[pylons-discuss] bootstrap and forms in tabs ?

2014-03-04 Thread Jonathan Vanasco
Wondering if anyone else has run into this... I have some forms in bootstrap that are in tab-panes. In order to handle a form re-print, one needs to show the tab by specifying an active css class on the tab and tab-pane (or triggering a js action). The name of the 'active' tab/pane set is

Re: [pylons-discuss] bootstrap and forms in tabs ?

2014-03-04 Thread Jonathan Vanasco
thanks for the fast reply. i've experimented with that on a few views before, but never for a form submission. do you POST into /path/to/submit#pane ? On Tuesday, March 4, 2014 12:09:09 PM UTC-5, Vincent Catalano wrote: When dealing with bootstrap's tabs I prefer to handle which tabs should

Re: [pylons-discuss] bootstrap and forms in tabs ?

2014-03-04 Thread Jonathan Vanasco
Thanks for the clarification. That solution won't work for us. We only redirect on form success, not on form error. form errors are handled within that request. redirecting to a form page with GET would be a pain, because we'd have to encode the entire form submission into a GET string and

[pylons-discuss] Re: how to organise files in model package using sqlachemy?

2014-03-02 Thread Jonathan Vanasco
In addition to what Vincent noted, I also like to do the following: |-- models |-- __init__.py |-- _core.py |-- api.py _core.py -- anything that is shared across the other files in the package. i.e. a base class, mixins, etc api.py -- although I still import everything into

Re: [pylons-discuss] passwords in .ini files?

2014-02-27 Thread Jonathan Vanasco
1. Depending on your database/infrastructure, I don't think the sqlalchemy url necessarily needs to be protected. Someone would need to gain console access to one of our servers in order to connect with our DBs, and at that point... security concerns like that are a lost cause. 2. Third-Party

[pylons-discuss] Re: pyramid_mako alpha release 1.0

2014-02-27 Thread Jonathan Vanasco
should this be a simple upgrade, or are there any migrations to do, things to watch out for ? -- 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

Re: [pylons-discuss] pyramid_ldap and Python 3

2014-02-25 Thread Jonathan Vanasco
ldap compatibility is by no means a measure of utility to web-applications. i've seen very few webapps need ldap, though many GUI and email systems often need it. i'm wasn't a fan of python3 for web development about a year ago, because most of the core web utilities I needed weren't ported

Re: [pylons-discuss] Re: pyramid_debugtoolbar 2.0 released - now with ajax!

2014-02-24 Thread Jonathan Vanasco
The panel api was definitely changed. The docs were not. Ticket submitted. The previous versions rendered a template in a way that is 'typical' of pyramid apps in a 'content' function. The new version renders a template based on a 'self.data' dict that is populated on __init__ ; not having

Re: [pylons-discuss] Re: pyramid_debugtoolbar 2.0 released - now with ajax!

2014-02-24 Thread Jonathan Vanasco
also, the new system is GREAT. thanks everyone responsible! amazing work! -- 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

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