Re: deform: is it possible to invalidate a form / field manually ?

2012-02-08 Thread Jonathan Vanasco
actually, the param_source should support: GET POST params (GET & POST) the idiomatic example would be an email verification routine- someone is emailed a message that contains the form submission in a GET query string, and a formerror would return to a 'blank' form that submits via POST - allowi

Re: SetCookie on redirect

2012-02-08 Thread Jonathan Vanasco
i ended up packaging this for distro, because i needed it on a couple of projects https://github.com/jvanasco/pyramid_subscribers_cookiexfer -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@g

writing unit tests that cover pylons and pyramid

2012-02-10 Thread Jonathan Vanasco
my tests keep failing on pylons packages. actually, i can't even run the tests. i've traced the error to this being in my packages: from pylons import c works fine in production, but not in testing looking at pylons/__init__.py, i see this line: tmpl_context = c = StackedObjectProxy(na

Re: writing unit tests that cover pylons and pyramid

2012-02-11 Thread Jonathan Vanasco
It's the same system & virtualenv. it's just that 'using' the package seems to work fine, but testing it fails. c is exported in pylons , but that double assignment line seems to not define it via an import. i guess there's some pylons bootstrap code that needs to be run. in any event, based on

Re: writing unit tests that cover pylons and pyramid

2012-02-11 Thread Jonathan Vanasco
actually, screw that. unit testing for a series of helper wrappers is too difficult in pylons. pyramid and 'core' usage gets covered. pylons doesn't. now i'm going to brunch! -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this gr

Re: Akhet 2.0 released

2012-02-14 Thread Jonathan Vanasco
congrats! few comments. 1. it looks like you dropped pyramid_handlers -- any reason? 2. i think it would make sense to mark up demo/__init__.py more with comments to show what is going on. i remember having to reverse engineer some of the stuff that was happening in the earlier akhet, and final

Re: van.static: Offloading static resources to a CDN

2012-02-14 Thread Jonathan Vanasco
this looks pretty neat. there are a few things I'm confused by. Exactly how is the switch handled on templates ? What configuration is needed on the app ? The approaches I've seen are either: 1- Some sort of post-processesing regex 2- Prepending static files with a cdn call. i.e. The S3 confu

Is there a good idiomatic way to connect to a database on startup ?

2012-02-14 Thread Jonathan Vanasco
I typically use reflection under sqlalchemy, so my apps fail to start if there is any database issue. I'm working with declarative on a quick project, and wanted to know if there's a 'proper' way to ensure database connectivity on startup. -- You received this message because you are subscribed

what are the benefits of transaction and pyramid_tm / are they necessary ?

2012-02-14 Thread Jonathan Vanasco
I recently learned that pyramid_tm closes the session on a transaction.commit() I also learned that either transaction or pyramid_tm automatically commits at the end of a request I'm not comfortable with either of these behaviors, particularly the latter I've run into too many situations where m

Re: Pyramid advocacy, list of high profile sites?

2012-02-15 Thread Jonathan Vanasco
i wrote a long response yesterday, and it seems it didn't post. f'ing google. The Pylons list is here: http://wiki.pylonshq.com/display/pylonscommunity/Sites+Using+Pylons For your purposes I would just talk about Pyramid being the new versions of Pylons. There are plenty of large sites in there

Re: Pyramid: how to check browser cookies support

2012-02-15 Thread Jonathan Vanasco
there are a few things that could the cause of your problems. I'll repost on stack overflow. Before I continue... FYI Pyramid uses WebOb to handle request and response objects There's an overview here: http://docs.webob.org/en/latest/reference.html And class documentation here: http://doc

Re: what are the benefits of transaction and pyramid_tm / are they necessary ?

2012-02-15 Thread Jonathan Vanasco
try: do stuff database.commit() email.send() except: so I'm fine with the paradigm you're suggesting ;) On Feb 15, 1:26 pm, Mike Orr wrote: > On Wed, Feb 15, 2012 at 8:47 AM, Marius Gedminas wrote: > > On Tue, Feb 14, 2012 at 03:16:00PM -0800, Jonatha

Re: Distribution not found error

2012-02-15 Thread Jonathan Vanasco
did you run `setup.py develop` ? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com.

pyramid_mailer and sendmail

2012-02-17 Thread Jonathan Vanasco
has anyone built something similar to pyramid_mailer that is compatible with sendmail ? pyramild_mailer seems to be a light wrapper around repoze_sendmail which, despite its name, has no support for sendmail. i just prefer to use sendmail for development work, as it requires no additional configu

Re: pyramid_mailer and sendmail

2012-02-17 Thread Jonathan Vanasco
thanks. i meant '/usr/bin/sendmail' as a wrapper to exim/postfix. does anyone even use the real sendmail anymore ? ;) I'll see if i can use it on localhost:25 . Years ago, that required a lot of wrangling on Macs to work - you had to set up accounts and all sorts of crap. it's probably changed,

Re: Help with using the subprocess module in a Pylons controller

2012-02-17 Thread Jonathan Vanasco
how long does this create? if its longer than 'instantly', i'd move to a processing queue concept. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this

Re: creating an abstraction layer class to manage resources

2012-02-18 Thread Jonathan Vanasco
i tend to structure applications - python, php, whatever - like this: - I use multiple Database Handles. This is always at least a "reader" and a "writer". On the database level, the reader is privileged to only select from databases, while the writer may read and write. If the application need

Re: creating an abstraction layer class to manage resources

2012-02-18 Thread Jonathan Vanasco
i personally wouldn' do that, because my SqlAlchemy classes are really just used for populating a read-only cache -- which is a dict -- and creating/editing records. in your case... and I'm just thinking out loud... 1. you could create an abstract class called CacheBacked, which your Reflected/De

Re: need your help to overhaul docs

2012-02-22 Thread Jonathan Vanasco
Just wanted to add to this discussion , for potential things to address in the docs: The security authorization/authentication stuff is a bit intense. At first glance, it looks and reads very much like an "enterprise software" type of system, with a lot of overhead. If I were building a CMS or a

a question for anyone using formencode and pylons/pyramid ...

2012-02-22 Thread Jonathan Vanasco
the request get/post data comes in from pyramid as unicode strings. the values i have in the database / my code for constant on many items are integers let's use this as an example... account_type_ids= (1,2,3,4,5) other_type_ids= (1,2,3,4,5) third_type_ids= (1,2,3,4,5) is there a bet

Re: Architecture of a backbone+pyramid single page app

2012-02-23 Thread Jonathan Vanasco
here's an example of the method i use... https://gist.github.com/1896363 it's tailored to using jquery, but not hard to change. 1. i set everything to have an 'rval' that will return - at the least - an error or success note. 2. i keep everything in a versioned API . these views map to "/api/

Re: a question for anyone using formencode and pylons/pyramid ...

2012-02-24 Thread Jonathan Vanasco
Crhis- thanks. i'm on that list as well. this seems to be more of an 'implementation under pyrmaid' question than about how formencode works, which is why I asked here. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, s

Re: a question for anyone using formencode and pylons/pyramid ...

2012-02-24 Thread Jonathan Vanasco
also, thanks all. It seems like Pipe(Int(),OneOf()) is the 'right' option, as it'll get me the ints i want. cd34's suggestions were dead on and way better than my sleepless hack of string tempating ! -- You received this message because you are subscribed to the Google Groups "pylons-discuss"

Re: Repoze-dev subscription not working

2012-02-24 Thread Jonathan Vanasco
On Feb 24, 2:57 pm, Chris McDonough wrote: > I don't know how to tell you to turn off the console output, either, > sorry.  Have you tried reading the source code of Turbogears where it > sets up the r.who stuff?  The repoze.who configuration stuff accepts a > logger; apparently TG is passing one

Re: Repoze-dev subscription not working

2012-02-24 Thread Jonathan Vanasco
For debugging on a local machine, where there is a single page request and any concurrent requests come from static elements, it works perfectly. I wouldn't , and didn't , suggest that for production -- which also would also almost never have logging set to debug. -- You received this message be

Re: Feedback request for custom scaffolding

2012-02-27 Thread Jonathan Vanasco
You should share the pypi and github links in the future. It makes it easy to dive in without installing first. http://pypi.python.org/pypi/pyramid_modern https://github.com/KamiQuasi/pyramid_modern -- You received this message because you are subscribed to the Google Groups "pylons-discuss" g

is there a facility in pyramid for sending/validating encrypted cookies ?

2012-02-28 Thread Jonathan Vanasco
I didn't find anything in the docs, but I figured it would be worth asking. I am porting over a login system from Pylons. One of the elements has a "cookie_autologin", which sets a 30day cookie if someone clicks "remember me". the contents of the cookie are a lightweight payload + checksum. I f

Re: is there a facility in pyramid for sending/validating encrypted cookies ?

2012-02-29 Thread Jonathan Vanasco
on. > Pyramid doesn't ship with any encryption capabilities. > b) See p.session.signed_serialize and p.session.signed_deserialize for > signing a payload. > > http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/api/sess... > > On Tue, Feb 28, 2012 at 11:44 AM, Jona

Re: is there a facility in pyramid for sending/validating encrypted cookies ?

2012-03-01 Thread Jonathan Vanasco
ok, mostly ported over. https://github.com/jvanasco/insecure_but_secure_enough i'll have it on pypi shortly - having a pain with getting the distribution right while watching a puppy -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to

multiple beaker sessions under pyramid ?

2012-03-01 Thread Jonathan Vanasco
has anyone attempted this yet with pyramid_beaker , or a custom implementation ? much like the folks who asked about "multiple beaker sessions under pylons" [ http://groups.google.com/group/pylons-discuss/browse_thread/thread/62fbd23305db7dcc?fwc=1 ] , i'd like to have a beaker session for accoun

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
I'm close do doing this with a middleware hack. I looked into extending pyramid and pyramid_beaker to support a request.session_https option. That is going to add a chunk of code - so I should ask first... is that something worth doing ? -- You received this message because you are subscribed t

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
the config.set_request_property sounds like it'll be *perfect* i'll whip up a distributable based on that -- will be much better than hacking at pyramid core! On Mar 5, 6:21 pm, Michael Merickel wrote: > On Thu, Mar 1, 2012 at 8:54 PM, Jonathan Vanasco wrote: > > > has any

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
I've got a monkeypatched version that seems to work right now ( https://gist.github.com/1983280 ). It was the most straightforward way of compiling all the relevant pieces from Pyramid / Pyramid_Beaker. I say "seems" , because I don't have my local server setup to test with https, it works on por

Re: multiple beaker sessions under pyramid ?

2012-03-06 Thread Jonathan Vanasco
pyramid_subscribers_beaker_https_session https://github.com/jvanasco/pyramid_subscribers_beaker_https_session i've got it supporting two methods: 1. config.set_request_property 2. a NewRequest listener that manually sets the property the latter option is likely to leave, but i already named it

Re: Pyramid in Production

2012-03-08 Thread Jonathan Vanasco
Not talking about Pyramid / WSGI layer itself... Assuming that these are just "skinning" a platform for customers, I would keep away from running each application on a separate IP and try to handle them via virtualhosts. The rationale for this is: 1. It's easier to step & repeat for new clients 2

Re: Overriding (blocking) Set-Cookie per view

2012-03-10 Thread Jonathan Vanasco
off the top of my head, you could use a subscriber. you should be able to write something for NewResponse that strips whichever cookies you want. i wrote a package that does pretty much the exact opposite of what you want... https://github.com/jvanasco/pyramid_subscribers_cookiexfer that sho

anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
I'd like to limit certain operations to https , instead of http. The problem is that pyramid is often behind a front-end server , which is handling the http and https connections, and oblivious to the protocol. Does anyone have a good idea how to proceed ? The only thing I can think of is to hav

Pyramid Packages Demo

2012-03-10 Thread Jonathan Vanasco
Over the past few months, I've created about a dozen packages for use with pyramid and decided that I might as well start cobbling together a reference micro-application for them So far, I've begin integrating these 8 into an example application : * gaq_hub - centrally manages google anal

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
Hi Fabio- I do the same thing with cookies and the general setup. I wrote a library last week to handle encryption ( insecure_or_secure_enough ). My concern is how to know within Pyramid if the client downstream has connected within http or https. -- You received this message because you are s

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
On Mar 10, 4:35 pm, Michael Merickel wrote: > With a properly configured server you can just check request.scheme in a > predicate to determine if the request is over https. Awesome. As always, thanks! the exact answer i needed! -- You received this message because you are subscribed to the

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-11 Thread Jonathan Vanasco
fyi, these were the changes i needed to make: 1. Pyramid - Enable Paste Prefix Middleware [app:main] filter-with = proxy-prefix [filter:proxy-prefix] use = egg:PasteDeploy#prefix 2. Nginx - Ensure proper headers location / { # Configure Proxy Pass prox

Re: Threadlocals? Globals?

2012-03-14 Thread Jonathan Vanasco
Depending on what "Alice" is - and how you plan on scaling your application - I would either store the object in Beaker ( perhaps with memcached ) or serialize the underlying data into a no-sql store like Riak or Mongo. -- You received this message because you are subscribed to the Google Groups

how are file uploads processed in deform / pryamid ?

2012-03-14 Thread Jonathan Vanasco
hey- because almost every python package around thumbnailing images and s3 support is tied to a framework (really?!?!) i'm porting an old package from proprietary to BSD license. right now it's handling file handles and fieldstorage ( from formencode ). i'd love to support the full pyramid spect

Re: Plugin System for Pyramid? Howto?

2012-03-18 Thread Jonathan Vanasco
Someone more familiar will chime in with an expanded and better response , but I would look into these elements that I've encountered in the past few months: Pyramid has Event Subscribers: http://pyramid.readthedocs.org/en/latest/api/events.html There are also "hooks" http://pyramid.readt

Re: Plugin System for Pyramid? Howto?

2012-03-18 Thread Jonathan Vanasco
On Mar 18, 12:07 pm, Chris McDonough wrote: > You're probably going to want to investigate Pyramid's existing plugin > system before creating another one: how did i miss that in the docs , but see everything else!?!? so excited for the forthcoming updated docs. -- You received this message be

Re: Plugins, in general

2012-03-20 Thread Jonathan Vanasco
added 11 of my packages. On Mar 19, 4:03 pm, Michael Merickel wrote: > http://pyramid.opencomparison.org/ > > This page has stagnated since Danny originally set it up and it would be > wonderful if it could get some love. > > > > > > > > On Mon, Mar 19, 2012 at 2:16 PM, Mike Orr wrote: > > On Mo

catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
I'm using pyramid and SqlAlchemy, but not pyramid_tm. If the server is down, the following exception is raised: sqlalchemy.exc.OperationalError I'm wondering how i can best catch this , so i can handle internal alerts and possibly change the response. the only thing available in a NewRespon

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
; While the exception view is being handled, request.exception and > request.exc_info should be populated (at least on 1.3+), so you could deal > with that in a NewResponse subscriber if necessary. > > On Wed, Mar 21, 2012 at 12:10 PM, Jonathan Vanasco > wrote: > > > > >

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
On Mar 21, 2:11 pm, Michael Merickel wrote: > The only way a NewResponse subscriber would be invoked *after* an exception > occured is if you are handling the exception in an exception view. If > that's the case, then you are rendering a new view and as part of the > rendering, NewResponse will

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
https://github.com/jvanasco/pyramid_exceptionstest If you hit /hello_world it raises a ValueError. There is no Exception View configured for ValueError. The NewResponse subscriber catches it. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. T

anyone have a suggestion to do per-environment package 'constants' ?

2012-03-25 Thread Jonathan Vanasco
99% of my per-environment setups are handled in the .ini file, and available via the registry stash I have a few 'variables' that I need defined within a package scope, as I'm not going to have a request or event object handy. I put variables in quotes, because they're more like constants in Perl

Re: anyone have a suggestion to do per-environment package 'constants' ?

2012-03-26 Thread Jonathan Vanasco
those work at runtime , but I'm trying to define something on the app init e.g. lib/constants.py if PRODUCTION_MACHINE : VAR_1 = '123' VAR_2 = '123' elif DEV_MACHINE : VAR_1 = '456' VAR_2 = '456' this is, of course, an illustrativ

Re: anyone have a suggestion to do per-environment package 'constants' ?

2012-03-27 Thread Jonathan Vanasco
yramid's core, so at this point you're just > asking for ways to deal with this in Python. > > On Mon, Mar 26, 2012 at 12:48 PM, Jonathan Vanasco > wrote: > > > > > > > > > those work at runtime , but I'm trying to define something on the app

Re: Building Separate Front-End for Mobile and Computer

2012-03-27 Thread Jonathan Vanasco
Do you mean a JSON web API? If so , sounds like you're talking about a Service Oriented Architecture. To be honest, the *easiest* JSON APIs i've ever written were in Pylons/ Pyramid. You have full control of the request, and all you need to do is return a dict from a view/handler that is decorat

Re: is it safe to store data on handlers/views in "self", or should it be "self.request" ?

2012-03-27 Thread Jonathan Vanasco
FWIW, I started working on this approach a few weeks ago, and have been loving it. I attach two Pylons-style Attribute-Safe objects onto the request at init : request.app_meta request.workspace app_meta contains stuff like "is the user logged in?" , timestamp / datetimes for the request,

Re: What about a pyramid collective ?

2012-04-12 Thread Jonathan Vanasco
i think the big issue is about marketing and critical mass, and less about the exact details of functionality. I think a lot of concerns could be solved in two steps: 1. getting a "Framework :: Pyramid" classifier, which has been requested 2. having a page/module on the Pyramid site that does thi

anyone have some caching advice/strategy ?

2012-04-16 Thread Jonathan Vanasco
On my Pyramid project I've been using this general concept -- which i've used in the past : - everything on the '/account' uses SqlAlchemy objects and hits the database - everything on the rest of the site uses cached data that is assembled and in a dict format. this stuff is periodically refres

Re: pyramid trove classifier on pypi

2012-04-16 Thread Jonathan Vanasco
Congrats! On Apr 16, 6:05 pm, Michael Merickel wrote: > We've been granted a new trove classifier on PyPI, so feel free to > update your Pyramid-specific addons to use this instead of Pylons in > terms of improving searchability on PyPI. > > Classifier: > >    Framework :: Pyramid > > Thanks, > M

Re: Learning Python/Pylons

2012-04-17 Thread Jonathan Vanasco
I think Dive Into Python is still pretty good for helping someone with previous programming experience transition (its 8years old). It doesn't teach you any fundamentals, it just goes into examples and how/ why stuff happens. -- You received this message because you are subscribed to the Google

[Should I be able to do this?] Multiple @view_config for a single method

2012-04-18 Thread Jonathan Vanasco
I was trying to figure out how I could have: /path/to/section /path/to/section/{paginated:\d+} work for the same function this worked: config.add_route("user::list", "/users/list") config.add_route("user::list_paginated", "/users/list/{page:\d+}") @view_config(route_name="user::list") @view_c

Re: Multiple @view_config for a single method

2012-04-20 Thread Jonathan Vanasco
... > > > > > > > > On Wed, Apr 18, 2012 at 2:48 PM, Jonathan Vanasco > wrote: > > I was trying to figure out how I could have: > > > /path/to/section > > /path/to/section/{paginated:\d+} > > > work for the same function > > > thi

wildcard domains and routes

2012-04-29 Thread Jonathan Vanasco
I'm trying to integrate custom domains for a webapp that I've been building in my spare time. I can think of 2 ways of implementing this: 1. in nginx have a wildcard 'listen', then use url rewrite rules to map the custom URLS onto 'non-custom' webapp urls.ie MyCustomDomain.com -> webapp.com/s

Re: Python's memory hogging

2012-05-07 Thread Jonathan Vanasco
fwiw, I used to run into issues like this a lot under mod_perl. the apache process would lay claim to all the memory it ever used until a restart ( or max children is reached ). I used a few workarounds when i needed large data processing : - i called an external process and collected the results

Re: Mixing data and interface in RESTful app

2012-05-07 Thread Jonathan Vanasco
i generally hate this approach to web programming. i find it very shortsighted and unmanageable for those you're trying to service - if you change your website, the API more often than not causes apps to break. i see this popular in the rails community where not many projects last long. if you'r

Re: Mixing data and interface in RESTful app

2012-05-07 Thread Jonathan Vanasco
My point is that the "machine" version will need to be pegged to certain API versions - where consumers can expect to see certain data, and hope to see other data. The human version can constantly evolve, but the machine version needs to be static and documented. -- You received this message be

Re: Python's memory hogging

2012-05-07 Thread Jonathan Vanasco
On May 7, 11:50 am, "Vlad K." wrote: > On 05/07/2012 05:37 PM, Jonathan Vanasco wrote: > > > - eventually i would refactor the code to use a SOA setup and have a > > dedicated daemon handle the large stuff. > > But doesn't that suffer from the same set

Re: Default template variables

2012-05-10 Thread Jonathan Vanasco
Pylons had the concept of an attribute-safe object ( see below ) I toss it in /lib/helpers and use them throughout my code. I typically have my core handler stash an instance or two in the request object. All my template variables look to read off this object. === class AttributeSafeObje

testing question

2012-05-11 Thread Jonathan Vanasco
i'm trying to devise the simplest way to write/manage tests for ancillary urls ( legal, contact, etc) and just general 'does this even render' the first generation of my tests look like this: def test_ancillary(self): urls= [ '/', '/about', '/about/

Re: testing question

2012-05-11 Thread Jonathan Vanasco
ah! thanks. time to rewrite! On May 11, 12:40 pm, Michael Merickel wrote: > The unittest assert* functions have an optional msg parameter. > > On Fri, May 11, 2012 at 10:46 AM, Jonathan Vanasco > > > > > > > > wrote: > > i'm trying to devis

Re: Unit testing Pyramid app with beaker sessions

2012-05-13 Thread Jonathan Vanasco
assuming your test works something like this... class IntegrationTestBase(BaseTestCase): def setUp(self): self.app = TestApp(self.app) any calls through self.app.get() / self.app.post() appear to stash response cookies in app.cookies() ; the same cookies might be viewable in the resp

Re: catching sqlalchemy exceptions

2012-05-15 Thread Jonathan Vanasco
nearly 2 months later, i figured this out. my errors were due to the debug system being enabled in development.ini the NewResponse subscriber is not caught in production.ini i'll flag this on the devel mailing list, as the docs for NewSubscriber or the Debug should reflect this. -- You receive

Re: SQLAHelper status

2012-05-16 Thread Jonathan Vanasco
i've been experimented with a replacement for a few months: https://github.com/jvanasco/pyramid_sqlassist it does what sqlahelper does, but is rewritten quite a bit ( and experimental ) to get the following done: - reflect tables - support multiple database connections it seems to work correctl

Re: pylons.url() adding fastcgi's socket name to urls

2012-05-17 Thread Jonathan Vanasco
can i suggest setting up a test page that dumps the request & environment variables ? there might be something there that gives you a clue. lighttpd is weird. it might be configured to prepend something into your env. -- You received this message because you are subscribed to the Google Groups

Re: Cannot find place where pyramid application writes logs

2012-05-21 Thread Jonathan Vanasco
http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html?awesome Under "Advanced Configuration" """To capture log output to a separate file, use a FileHandler (or a RotatingFileHandler):""" ( instructions continue ) Also, you'll note at the top of the docs: """The pserve comman

Re: Admin Backend for Pyramid

2012-05-23 Thread Jonathan Vanasco
There are a few projects that have been working in the CRUD space on pyramid. There was a pyramid-crud sprint a while back too. Personally, I build out the CRUD interfaces myself. The types of Apps I've built / want-to-build on Pyramid are impossible if not utterly painful to implement on framew

Re: More than one language

2012-05-23 Thread Jonathan Vanasco
if i couldn't use a database for this, i might personally opt for using an include system. something like this: -translations.mako * defines textblocks like: website_right( language ): %if language == 'en': hello! %elif language == 'fr': bonjour %endif page.mako * includes tran

Re: plugable authentication

2012-05-28 Thread Jonathan Vanasco
One of my companies built a framework based on a similar concept a while back on Pylons, and deployed around a dozen apps on it for ourselves and our clients. It was really neat to get things off the ground, and quickly became a pain-in-the-ass as projects went through agile iterations -- everythi

Re: Pylons/Pyramid Performance

2012-06-06 Thread Jonathan Vanasco
1) Just to add on Overhead stuff as mentioned above, I've honestly never seen a webapp that connects to a Database ( Mysql, Postgresql, Couch/Mongo/etc ) or exists in a SOA talking to other daemons/apis, where the webapp was the bottleneck. In my experience, it's always been the database or inter

Re: Pylons/Pyramid Performance

2012-06-07 Thread Jonathan Vanasco
YouTube and many other major properties adopted Lighttpd around 2005-2008. It was the first high performance lightweight server , with documentation in English. It also had a lot of memory leaks and other bugs. But it had high performance and you could just have a cron-job kill&respawn it hourly

Comparison of Deployment Options ?

2012-06-07 Thread Jonathan Vanasco
Has anyone done a comparison of deployment options yet ? There seems to be a couple of options illustrated in the Pyramid cookbook and Stack Overflow -- but I'm wondering if there's an actual comparison listing the pros/cons of the various methods. from the various benchmarks that don't include P

Re: Updating a session mid-request

2012-06-08 Thread Jonathan Vanasco
I think you're dealing with either a locking issue or a bug in beaker. check out the comments here: https://bitbucket.org/bbangert/beaker/issue/101/naive-dog-pile-effect-implementation. if there's a race issue with locks: """I think you misunderstand the action of the dogpile lock. The next clie

Re: Cannot find place where pyramid application writes logs

2012-06-08 Thread Jonathan Vanasco
now that i'm trying uwsgi , i'm running into the same situation would anyone mind sharing their configuration for logging under this? it's really hard to troubleshoot my integration right now. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. T

Re: Cannot find place where pyramid application writes logs

2012-06-09 Thread Jonathan Vanasco
I eventually figured some stuff out. I figured I'd post my learnings here -- it's largely a recollection of the above, but with some context: Configuring your environment.ini or app --- for simplicity, you can put everything into a uwsgi block. all of these ca

urllib2.urlopen kills uswgi worker in pyramid app -- anyone else experience this ?

2012-06-12 Thread Jonathan Vanasco
wondering if anyone else has run into this. this will cause uWSGI to die ( DAMN ! worker 1 (pid: 6809) died, killed by signal 10 :( trying respawn ... ): import urllib2 result = urllib2.urlopen( 'http://cnn.com' ) any url will work. took a while to track this down -- nothing in the logs

Re: Compiling Python

2012-06-13 Thread Jonathan Vanasco
On Jun 13, 9:21 am, Chris McDonough wrote: > That wording should probably be revisited because you're not the first > to ask.  More accurate is the statement "it's a real pain in the ass > when someone walks into IRC and gives us a Python compilation scenario > that can only be replicated with

Re: Running pserve as another user causes import error

2012-06-13 Thread Jonathan Vanasco
I'm just wondering -- do you get the same errors with --user or -- group as you do with both --user & --group ? i typically deploy like this: $ sudo bash $ su www-data $ cd /var/www/virtual_envs $ virtualenv maypp-2.7 ## or whatever python version $ source /var/www/virt

Re: How would I do cross domain with Pyramid and Nginx

2012-06-14 Thread Jonathan Vanasco
i started typing this before i saw andi's repsonse. If both these domains are on the same machine... nginx has a facility to allow one request to "authorize" a second request. it's the x-accel / x-sendfile modules. http://wiki.nginx.org/X-accel if they're on different machines : - you can pr

Re: dogpile.cache 0.1.0 released

2012-06-15 Thread Jonathan Vanasco
Ravi- it took me about 10 minutes to migrate from beaker to dogpile in a pyramid app. most of the work was done by find/replace and then i just checked for oversight. in a few places i specifically named the cache keys, so that was a bit more work -- but still within 10 minutes. from what i wen

Re: Packaging/Distributing pyramid apps

2012-06-15 Thread Jonathan Vanasco
pip will also reinstall all dependencies (ie: already met ones) every time you upgrade a package. it's infuriating and annoying. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups

Re: Packaging/Distributing pyramid apps

2012-06-15 Thread Jonathan Vanasco
my preferred solution right now is: merge sourcecode into a 'current_deployed' tag/branch use fabric/fabfile to ssh into the server , checkout the build, install it into the virtualenv using 'development mode', set a few symlinks, and relaunch the app i decided against running everything through

Re: Why are both authentication and authorization policies required ?

2012-06-19 Thread Jonathan Vanasco
FWIW, I use my own authorization and authentication schemes -- ie, I don't use any of pyramid's auth. You're not required to. It's fairly trivial to just roll your own. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, s

Re: How to get request object inside decorator?

2012-06-19 Thread Jonathan Vanasco
If you are using class-based views, it's pretty easy... def decorated( ok=True ): log.debug("decorated -- decorated()") def decorator( wrapped ): log.debug("decorated -- decorated.decorator()") def wrapper( self, *arg, **kw): log.debug("decorated -- decorated.de

Re: How to get request object inside decorator?

2012-06-20 Thread Jonathan Vanasco
On Jun 20, 1:28 am, Alexandre Conrad wrote: > Oh, that's good to know! Thanks! Pyramid needs a cheat-sheet that's just a listing of all these random "generic (supported)" idioms. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to t

Re: About Pyramid

2012-06-20 Thread Jonathan Vanasco
On Jun 20, 7:17 am, "Biswas, Pinakee" wrote: > 1.       I think there is no controller in Pyramid and I think the Views > probably plays the role (for what is there in Pylons). In Pylons, I could > have multiple controllers (or python files/modules in controller folder to > say in crude way). I

Re: AuthTktAuthenticationPolicy with custom Session objects

2012-06-21 Thread Jonathan Vanasco
if you're using beaker sessions: session.invalidate() leaves the cookie, but kills the server side data associated with it. session.kill() kills the cookie, but a new session/session_id/ cookie is created. i'm not sure what the other session backings do. fwiw, I was just as confused as y

Re: Queries on Pyramid API

2012-06-21 Thread Jonathan Vanasco
> 1.       In Pylons, there is a config API which could be used to read the > fields in the .ini (development.ini or deployment.ini) file. Is there > something similar in Pyramid? all of that information is stored in the request object under: request.registry.settings > 2.       In Pylons, the

Re: Queries on Pyramid API

2012-06-21 Thread Jonathan Vanasco
nope. return and raise are handled differently. i ran into it while writing my cookie xfer module there's an illustration of the difference here: https://github.com/jvanasco/pyramid_subscribers_cookiexfer i also brought it up in a discussion on this group once before. you'd have to inspect the

Re: suppressing cookie handling errors

2012-06-22 Thread Jonathan Vanasco
can you post a full traceback ? iirc, pylons used/subclassed webob's request and response... so if there is a bug , it's probably in webob and would need to be fixed there. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group

Re: event suscriber, request property or session

2012-07-02 Thread Jonathan Vanasco
> - adding a property to the request with 'set_request_property', like: >       myconf.set_request_property(calculate_user_inbox, 'inbox') > > - Using an event suscriber: >      myconf.add_subscriber('myapp.calculate_user_inbox_suscriber', >                            'pyramid.events.NewRequest')

Re: Jquery Ajax call and Pylons request interaction

2012-07-06 Thread Jonathan Vanasco
they'd also be in: request.params request.GET (if get) request.POST (if post) so you could do: import simplejson as json data = json.loads( request.params.get('data') ) -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group,

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