Re: Pyramid Books Published by O'Reilly

2013-03-25 Thread Jonathan Vanasco
On Mar 25, 12:35 pm, Steve Schmechel wrote: > In order to make creating a web application like "configuring an XML file", > your framework must be very opinionated, which Pyramid is not.  I think > there are two different audiences here and you are never going to change > Django "configurers" in

Re: Pyramid Books Published by O'Reilly

2013-03-25 Thread Jonathan Vanasco
On Mar 25, 1:47 pm, Chris McDonough wrote: > Errr.  I've written a Django app, and it wasn't anywhere near like just > changing a config file.  It's a lot like writing an app under any other > web environment... requests, view callables, templates, integration with > 3rd party libraries and syst

Re: Pyramid and Mass mailing tool

2013-03-28 Thread Jonathan Vanasco
The cheapest option would be to host the images on Amazon S3 and send the email with Amazon SES. SES charges a 10¢ CPM , and data transfer in is free ( so you don't have to run the app on EC2 ). You do pay bandwidth, but it's their standard 12¢/GB charge. Your effective CPM ends up being around

Re: What is and isn't Pyramid

2013-04-04 Thread Jonathan Vanasco
A couple points from experience: More so than ORMs, random features, extensibility, flexibility, Magic going on behind the scenes -- Pyramid lets the development team and product managers decide where the Technical Debt and Bottlenecks will be -- and is designed in a way that you don't have to scr

Re: Pylons and CDN

2013-04-08 Thread Jonathan Vanasco
can you share some urls so we can see? -- 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

Re: use tween to centralize redirection or something else

2013-04-08 Thread Jonathan Vanasco
are you using Pyramid's auth already ? -- 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

Re: Pylons and CDN

2013-04-09 Thread Jonathan Vanasco
You should look at your HTML source and your Apache logs. This most likely has nothing to do with Pylons. You should ensure that you can access the items via the urls that you are generating ? My guess is that either: - your cdn or origin server is configured to respond to (www.)? example.com ,

Re: simplest possible background process for file upload

2013-04-12 Thread Jonathan Vanasco
off the top of my head: 1. celery 2. fork a process to handle the uploads 3. register a cleanup handler 4. homegrown batch / daemon -- log the upload locally, then process the upload separately in my personal experience -- the main thing i'd watch out for is the book-keeping/accounting portion o

production logging and errors

2013-04-12 Thread Jonathan Vanasco
I'm trying to track down where bugs happen on production code. The Traceback in the logs doesn't have the URL. The best option I see, is to look for a line like this after the URL : [pid: 23566|app: 0|req: 251/251] 206.217.86.228 () {42 vars in 1695 bytes} [Fri Apr 12 16:02:39 2013] GET /acc

Re: Help with SQLAlchemy

2013-04-13 Thread Jonathan Vanasco
> just guessing, but this seems wrong: ``filter_by(id = payment.id)``. > shouldn't it be ``filter_by(id == payment.id)``? `filter_by` expects kw args ( `=` ) `filter` expects args/expressions ( `==` ) http://stackoverflow.com/questions/2128505/whats-the-difference-between-filter-and-filter-by-in

Re: URL generation in Pylons

2013-04-15 Thread Jonathan Vanasco
You've been posting a lot of issues regarding your site and CDN. You didn't answer my question about sharing code or a url, so I tried the one in your signature Looking at the HTML for http://www.vvidiacom.com/web , I see a lot of templating code that was not executed: Here are some examples:

Re: Split testing in Pyramid - any experiences?

2013-04-15 Thread Jonathan Vanasco
how are you invoking templates? with @view_config or render_to_response ? i was digging into the default renderers last week; they largely just proxy + wrap a template lookup from the base library. On Apr 10, 1:30 pm, Benjamin Sims wrote: > Hi, > > I'm trying to implement split testing for a Py

Re: GSoC 2013 - NotAliens/SQLAlchemy Project

2013-04-16 Thread Jonathan Vanasco
Hi Josh! I'm a Pomona alumn myself (2000). I'm way too busy to take lead on this, but I'd be glad to help another Sagehen if you ever run into trouble or want to talk/skype about any general Pyramid questions. -- You received this message because you are subscribed to the Google Groups "pylons

Re: 'data' directory

2013-04-19 Thread Jonathan Vanasco
resurrecting this back from the dead... would anyone know how to access the 'here' off a request object ? is it possible? If not, would someone know how/where to patch the settings to support this? looking through the source, I only see 'here' value being set during logging setup. -- Y

Re: race condition mako template and scoped_session

2013-04-23 Thread Jonathan Vanasco
the problems you're describing seem to be random , and not necessarily tied to render vs render_response. it looks like you're using sessions incorrectly , and probably seeing issues pop up because some pages are lazyloading attributes while others don't have an attribute to load. scoped_ses

Re: error with client disconnection when uploading files, stuck!

2013-04-25 Thread Jonathan Vanasco
Is this happening only on linux or is it happening on other os's ? if you can make a short reproduceable example, i can test on osx for you. > > i'm only noting that because i've run into problems before where beautifulsoup died on large files in linux , but worked fine on osx. there ende

Re: GSoC 2013- Pylons.Pyramid -- Better Debug tools

2013-04-25 Thread Jonathan Vanasco
for the new debugtoolbar, could you (please) look into not making it trigger multiple requests / events ? that's been a pain in the ass when debugging event subscribers. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from

Re: GSoC 2013- Pylons.Pyramid -- Better Debug tools

2013-04-25 Thread Jonathan Vanasco
On Thursday, April 25, 2013 7:33:03 PM UTC-4, Michael Merickel wrote: > > Better isolation is a major motivation behind the new debugger. That and > being able to debug ajax/api requests. Don't worry, what we have in ours > heads (not on paper) is the bees knees! > sweet! -- You received th

multiple requests within a pyramid commandline script

2013-04-29 Thread Jonathan Vanasco
I have a convenience class for my commandline scripts: from pyramid.paster import bootstrap class IntegratedApi(): env = None bootstrapped = None def __init__(self): self.env = bootstrap('../../../web-pylons/app/production.ini')

response from a string ?

2013-04-29 Thread Jonathan Vanasco
what's the best way to create a response from a string ? it's not a file to serve or a template to render. it's driving me a bit crazy trying to figure out a simple/idiomatic way to do this. ( i can do it in a complex , obtuse way that will be a pain to maintain ) -- You received this messa

Re: response from a string ?

2013-04-29 Thread Jonathan Vanasco
> > Are you looking for something other than: > > > > from pyramid.response import Response > > return Response("Hey!") > Nope, that's it. Thanks. I couldn't find anything that noted 'Response()' would work they way I wanted it to ( it does ). I was looking in all the wrong places. I'm

Re: error with client disconnection when uploading files, stuck!

2013-04-30 Thread Jonathan Vanasco
if it happened on linux+windows, then it's probably not an issue with the environment. -- 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

Re: GSoC 2013- Pylons.Pyramid -- Better Debug tools

2013-05-01 Thread Jonathan Vanasco
I'm just going to wishlist something. not sure if it is doable or not... but I get stuff like this a lot in my Tracebacks TypeError: __init__() got an unexpected keyword argument 'ssl_verify' The reason is that i sometimes end up forking a library to patch it. ( in this case, Twython ).

Re: Chameleon macro examples

2013-05-03 Thread Jonathan Vanasco
Have you looked at Jinja2 ? You can customize the escape characters so that it nearly looks like Mako (or Moustache). Not sure if it suits your other needs, but it has pretty decent template inheritance and macros. I'm prototyping some 'user editable templates' with Jinja2 and the sandbox mod

Re: Pylons DeprecationWarnings

2013-05-15 Thread Jonathan Vanasco
what version of of pylons are you using ? there are some yet-to-be documented compatibility issues with newer versions of WebHelpers and other external libraries against the 1.0.1 branch. I'm not sure what the 'max supported version' is, but i would suggest dropping down to the lowest specif

Re: Pyramid authentication and rest api

2013-05-16 Thread Jonathan Vanasco
Gaston, Could you explain this a bit more? Some of your intent isn't clear. I'm guessing you're not a native english speaker ? I'm not sure what certain lines are referencing. > We've built a rest API that's reached by ajax calls. Is that in Pyramid or Kivy ? > We'd like to use the same o

Re: Pyramid authentication and rest api

2013-05-16 Thread Jonathan Vanasco
General ideas 1. If you can use an browser window, you may be able to use Porthole.js ( http://ternarylabs.github.io/porthole/ ). That would let you authenticate into the web system, and then proxy requests / responses through the authenticated window. 2. I foresaw something like this in

will(can) pyramid work under the "-O" optimization flag ?

2013-05-16 Thread Jonathan Vanasco
It looks like it is doable via uwsgi , but not under `pserve`. thoughts ? -- 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...@googlegro

making before_render events conditional ?

2013-05-17 Thread Jonathan Vanasco
I've got a subscriber to before_render that does some "tweaking" of objects and priming of an object cache for Mako/Jinja/etc templates. The problem that I've run into – json calls to the api trigger this. The following code works, just wondering if anyone has a better idea , that would let me

Re: making before_render events conditional ?

2013-05-17 Thread Jonathan Vanasco
On Friday, May 17, 2013 3:04:18 PM UTC-4, Tres Seaver wrote: > > if event.get('renderer_name') == 'json': > return > That works perfectly, thanks! -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and

Custom Error Reporting via NewResponse ?

2013-05-19 Thread Jonathan Vanasco
Has anyone tried to accomplish this before? If so, could you share any details ? I was hoping to create some error logging , outside of the traditional `logging` facility, where I could drop some error reports and other info into the database for profiling. Instead of hacking on a logging co

statsd profiling

2013-05-23 Thread Jonathan Vanasco
i decided to integrate some profiling with statsd, and it was really easy. i use it for timing and profiling certain logical things, but also use it for some lightweight analytics based on the matched route i use a ContextFound event to start a timer, and then send a payload using `add_finished

Clarification about Tweens

2013-05-28 Thread Jonathan Vanasco
I'm looking at the Pyramid docs about `tweens` [http://docs.pylonsproject.org/projects/pyramid/en/latest/glossary.html#term-tween] and it reads: A bit of code that sits between the Pyramid router’s main request handling function and the upstream WSGI component that uses Pyramid as its ‘a

Re: unicode error?

2013-05-28 Thread Jonathan Vanasco
mako has some render settings that are configurable in the .ini file http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html#mako-template-render-settings the encode/decode error is a complete pain in the ass. i've run into it many times. a helper function I've used w

Re: Clarification about Tweens

2013-05-28 Thread Jonathan Vanasco
Great- both of you clarified this a lot for me. My problem was that first bit of the docs' description , where the tween sits between the App and Server didn't make it sound like it wrapped the app/request ( which is what a decorator does). tween factory : run at startup, decides if tweens wi

Re: pyramid_persona and unexpected logout behavior

2013-05-29 Thread Jonathan Vanasco
i'm not sure if this applies or not, but Safari doesn't accept cookies on a redirect. Most (possibly all) of the other browsers do. So if you're setting a cookie and then redirecting, Safari ignores it. -- You received this message because you are subscribed to the Google Groups "pylons-disc

scribe logging (thrift) under pryramid ?

2013-05-29 Thread Jonathan Vanasco
has anyone here done logging with scribe under pyramid? if so, a few quick questions: 1. which library did you use ? or did you just install the default lib ? 2. do you know if it's safe to use a global thrift Transport , thrift Protocol or Scribe Client - or if they should be per-request ? --

Re: pyramid_persona and unexpected logout behavior

2013-05-30 Thread Jonathan Vanasco
On Thursday, May 30, 2013 6:54:03 AM UTC-4, Georges Dubus wrote: > > Jonathan: I got rid of the redirect in last update, so that should not be > the problem. Isn't setting a cookie and redirecting advised in the pyramid > documentation by the way (in here fore example : > http://pyramid.readthed

disabling routes/views on deployment?

2013-05-30 Thread Jonathan Vanasco
we have a few routes/views that are used for testing is there a good way to disable them during deployment ( i.e. make them active depending on the environment )? in a perfect world , this would work : if settings.DEVELOPMENT : config.add_route("test_man","/test") unfortunately, t

Re: disabling routes/views on deployment?

2013-05-30 Thread Jonathan Vanasco
@michael- great ideas! thanks a ton! 1) use config.add_view for those routes so that you can add them to your > conditional > 2) place the special views in another subpackage that you scan only within > your conditional > #2 looks easy , i think i'll do that. > 3) write your own view_config

Re: disabling routes/views on deployment?

2013-05-30 Thread Jonathan Vanasco
On Thursday, May 30, 2013 7:15:13 PM UTC-4, Sontek wrote: > I use authorization policies for these. Something like > permission='group:developer' and then any user who hits that must have the > developer group. > we decided against using pyramid's authorization , and opted for a homebrew

Re: Should view callable pass request to resource?

2013-06-07 Thread Jonathan Vanasco
I could be wrong, it's been a while since I looked under the hood, but I recall module-level stuff being a factory for getting request-specific db connections. That being said, two tangents... 1. I'm always been huge fan of doing everything with request-specific objects. I've encountered a ha

Re: What's up with the website?

2013-06-12 Thread Jonathan Vanasco
On Tuesday, June 11, 2013 5:54:43 PM UTC-4, sams...@gmail.com wrote: > > Whoops. Meant to write there's no mention of Pylons 1.4.1 or 1.4.2, not > Python 1.4.1. or 1.4.2. The latest Pylons is 1.0.1 ; It's been put in maintenance mode with no further active development. Active development ha

Re: Pyramid + Velruse + OpenID via Google: how to get EMail

2013-06-13 Thread Jonathan Vanasco
I haven't used velruse, but with 3rd party auth libraries you often need to specify the 'scope' or 'attributes' that you want returned. It looks like velruse has support for scope and attributes in the source code, so you may not be using those options. (or it could not be working properly as

Re: multiple requests within a pyramid commandline script

2013-06-14 Thread Jonathan Vanasco
I need an opinion on the 'safety' of a potential approach... Calls to `pyramid.paster.bootstrap` are definitely what is taking too long ( 2.5s on dev ! ) Looking at the path of execution and relevant bits... `pyramid.paster` `bootstrap` calls `paste.deploy` `get_app` ( which looks to be e

Re: multiple requests within a pyramid commandline script

2013-06-14 Thread Jonathan Vanasco
thanks a ton! this helps a lot. it looks like i was on the right path! i built some maintenance and test scripts using the pyramid commandline docs. they're really great, but -- following the docs -- it's that call to boostrap() that takes a huge performance toll. being able to avoid that wi

Re: log by request

2013-06-15 Thread Jonathan Vanasco
On Saturday, June 15, 2013 12:04:12 PM UTC-4, Alexandre Conrad wrote: > > Today, I don't subclass the request object but I rather use a reify'ed > "add_request_method" to the request object on a Pyramid NewRequest event: > >> Funny, the first thing I said when I saw your subclass code was "This

is it possible to inspect object with the debug_toolbar on "good" requests ?

2013-06-17 Thread Jonathan Vanasco
I'd like to inspect some of the object attached to `request` in an interpreter. i never had the need to do this before... anyone know if it is possible? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and st

conditional sessions and pyramid_beaker ?

2013-06-18 Thread Jonathan Vanasco
We have an app that deploys over multiple domains DomainA is the "root" application and used for authentication , etc. It contains HTTP & HTTPS server-side sessions. Data is proxied to other domains via an iFrame lookup. DomainB - DomainZ are "child" applications. We'd like to drop the server-

Re: conditional sessions and pyramid_beaker ?

2013-06-18 Thread Jonathan Vanasco
t would pass in a > request and get back a session object based on some_criteria. There are > many variations on that theme but hopefully that's enough to go on. Let me > know if you need more details. > > > > > > > On Tue, Jun 18, 2013 at 10:47 AM, Jona

Re: remembering credentials with AuthTktAuthenticationPolicy

2013-06-19 Thread Jonathan Vanasco
I don't use Pyramid's Auth, but I have a suggestion based on what I do. I keep sessions locked to the Browser session. If someone clicks "remember me", they're given an "AutoLogin Cookie". It has an encrypted payload of their UID + Date, and the encryption scheme rotates. I believe our auth

Re: conditional sessions and pyramid_beaker ?

2013-06-20 Thread Jonathan Vanasco
S https://gist.github.com/jvanasco/5827488 -- 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

Re: conditional sessions and pyramid_beaker ?

2013-06-20 Thread Jonathan Vanasco
So it took me about 30 minutes to write this and get it working. I decided to abstract it for my own needs, but in case anyone else needs to use something like this (or just play around) : https://gist.github.com/jvanasco/5827488 A few neat things (i think): * you can implement your sessi

Re: make pyramid as the api server

2013-06-25 Thread Jonathan Vanasco
Just some bulletpoints : * Pyramid and Tornado can both easily handle the traffic and workload of API endpoints. * Pyramid is a library for building web applications. It is served in a WSGI container , like uwsgi or mod_wsgi * Tornado is a library for building web applications OR asynchronous

Re: dogpile.cache 0.5.0 released

2013-06-25 Thread Jonathan Vanasco
Mike - I'm thinking about forking pyramid_beaker into pyramid_dogpile ( so i can just drop beaker ). Would there be any feature requests if I proceed ? -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop

Re: Accessing the app's settings when no request is available?

2013-06-26 Thread Jonathan Vanasco
Can you do this without a request? It sounds like you just need to get to registry.settings ; I'm on mobile , but I recall there were some (not recommended, but might still work) ways to get at those without being tied to a request. you could also run some routine to register your app settings

Re: dogpile.cache 0.5.0 released

2013-07-05 Thread Jonathan Vanasco
functools has the lru_cache in python 3, and there's a backport on PyPI for 2.7 repoze has repoze.lru this seems to have a limit: https://pypi.python.org/pypi/GenericCache -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe f

Re: Do I need Pyramid for my [big] project?

2013-07-06 Thread Jonathan Vanasco
Pyramid is a great framework for building Web Applications in Python. Your "project" isn't a web application - it's a suite of applications, some on the web, and would require lots of engineering talent. Many of them could not be built in Pyramid or Erlang ( Smartphone apps, HTML/AJAX, etc );

Re: Understanding Pyramid Thread Generation

2013-07-08 Thread Jonathan Vanasco
On a related note, there are also forking concerns when you use a WSGI container like uwsgi. I never dug deep enough into Pyramid's or uwsgi's internals to see learn mroe about forking , but you may need a snippet like this if you use pycrypto with pyramid try: import uwsgi from Crypto

Re: Understanding Pyramid Thread Generation

2013-07-08 Thread Jonathan Vanasco
not sure. I literally copy/pasted that from the uwsgi site way back. looking at the code, it would probably be better to do something like: if RUN_UNDER_UWSGI : import uwsgi from Crypto.Random import atfork def post_fork_hook(): atfork() uwsgi.post_fork_hook = post_fork_

Re: Pyramid + pyramid_jinja2 + pyramid_simpleform and other doubts

2013-07-08 Thread Jonathan Vanasco
When I moved to Pyramid from Pylons, I didn't really like the deform or simpleform way of handling forms. I just don't like widgets. > > i preferred a way of form processing that I got used to with Pylons , and is very easy with class-based views under pyramid: class MyController(base):

Re: Understanding Pyramid Thread Generation

2013-07-10 Thread Jonathan Vanasco
Celery is typically integrated with a few moving parts. If you're using RabbitMQ, it probably works like this: 1. The Celery daemon is a "worker" and longstanding process. It pulls things out of a queue and does work. Sometimes it will save a result. Sometimes it will create new work. By

Re: performance impact of pyramid_tm

2013-07-11 Thread Jonathan Vanasco
I don't use transactions in pyramid , but am intrigued... 1. Assuming you're using sqlalchemy, and the interface to transaction is provided by the zope.sqlalchemy package , is there any actual database transaction ( begin; rollback ) for non-database requests ? ( ie, is the "transaction" entir

Re: duplicate sessions in pyramid application

2013-07-11 Thread Jonathan Vanasco
On Thursday, July 11, 2013 3:24:02 PM UTC-4, Vincent Catalano wrote: > > How are you using the session? Can you post your actual request function > code? > you should also share how you set up SqlAlchemy and the models. -- You received this message because you are subscribed to the Google Gr

Re: performance impact of pyramid_tm

2013-07-12 Thread Jonathan Vanasco
That all sounds great. thanks! -- 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

Re: Maintenance mode

2013-07-15 Thread Jonathan Vanasco
The easiest way is to enter/exit maintenance mode on the port 80 server ( nginx / apache ) with nginx, it's popular to 'touch' a file to enter maintenance mode -- so if "/var/www/sites/maintenance" exists, nginx will dispatch to another set of rules. some people will also just use a different

Re: Pragmatic introduction to zope.sqlalchemy, transaction and pyramid_tm?

2013-07-15 Thread Jonathan Vanasco
looking at your code, I looked at the sqlalchemy scaffold... and it seems a bit wrong / out-of-date. i'm going to post something to -devel now. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving

Re: Pragmatic introduction to zope.sqlalchemy, transaction and pyramid_tm?

2013-07-16 Thread Jonathan Vanasco
Looking at your covering to add a dbSession to a request -- http://pyramid.poeulfs.org/doc/sqla-doc/dbsession.html#adding-session-to-a-request it would (probably) be best to not use the lambda in `add_request_method`. it would be better if you followed the cookbook example -- which creates an

has anyone only used transactions for pyramid_mailer and not SqlAlchemy ?

2013-07-17 Thread Jonathan Vanasco
We're not using pyramid_tm for SqlAlchemy. We're considering using the deferred/queuing functionality of pyramid_mailer ( instead of send_immediately ), except that introduces zope.transaction into the mix. Has anyone else done this ? I went though the code, and there doesn't seem to be a way

Re: Migration from Pylons to Pyramid

2013-07-18 Thread Jonathan Vanasco
The migration guide is a good read and guide, but I'd wouldn't recommend using pyramid_handlers (which does some routing and view magic) or dropping things into a 'views' namepsace. Instead: * i'd keep the recommended 'views' namespace of Pyramid * use class-based view callables * migrate the

Re: has anyone only used transactions for pyramid_mailer and not SqlAlchemy ?

2013-07-18 Thread Jonathan Vanasco
> > Although the package comes out of the Zope world, its name is > just 'transaction'. If you don't add the glue (zope.sqlalchemy) which > wires up the sqlalchemy session into transactions, the presence of the > pyramid_tm tween should have no impact on the DB access. > That's what I though

Re: has anyone only used transactions for pyramid_mailer and not SqlAlchemy ?

2013-07-18 Thread Jonathan Vanasco
> The best documentation for "transaction" is in the ZODB Guide here: > > http://www.zodb.org/en/latest/documentation/guide/transactions.html > > Wrong URL. Here's the right one: > > http://zodb.readthedocs.org/en/latest/transactions.html > ha, that got me too! It took me a good hour last

Re: has anyone only used transactions for pyramid_mailer and not SqlAlchemy ?

2013-07-22 Thread Jonathan Vanasco
pyramid_mailer ended up not supporting savepoints ( due to a lack in repoze.sendmail ). i patched it last week , did some integrated tests this morning, and sent in a pull request. it will support it now! -- You received this message because you are subscribed to the Google Groups "pylons-d

Re: Avoiding get_current_request() in compatibility layer

2013-07-24 Thread Jonathan Vanasco
It sounds like you're talking about the same mechanism that the `transaction` package uses. IMHO, it would be better to be more explicit - but that might be a good start for you to look at (also at pyramid_tm, which handles the begin / commit-rollback ). Depending on how you handle an `adapter`

Re: How to implement hierarchical authorization schemes

2013-07-25 Thread Jonathan Vanasco
I dropped the Pyramid auth system. I found it too hard to work with , and too much of a resource strain. Instead of trying to fit my needs into it, I just built out my own solution from scratch. I could eventually have gotten my solution done with Pyramid's auth -- and we'll probably end up o

Re: How to implement hierarchical authorization schemes

2013-07-25 Thread Jonathan Vanasco
If you're caching SqlAlchemy data, convert it to a dict first and do your caching/operations on that; otherwise you'll deal with performance issues from session merging. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from thi

Re: deform or simple_form for bootsrap forms?

2013-07-26 Thread Jonathan Vanasco
If you're used to forms in Pylons, I ported a simpler formencode integration to Pyramid https://github.com/jvanasco/pyramid_formencode_classic/blob/master/pyramid_formencode_classic.py it might be a more natural way to handle your needs. i use it with bootstrap. -- You received this message

Re: Pyramid 1.5a1 relatively imminent

2013-07-26 Thread Jonathan Vanasco
small suggestion: 1. Add a PLANNED_DEPRECATION.txt file that just has the planned deprecations for future releases in it. ( ie, in 1.6 Pyramid will no longer support x,y,z; in 2.0 d,e,f are gone ). a handful of other projects do this and it's really useful. 2. Add a PLANNED_FEATURES.txt f

Re: Avoiding get_current_request() in compatibility layer

2013-07-27 Thread Jonathan Vanasco
i think you're looking at pyramid_tm which implements transaction. the zope transaction package ( https://github.com/zopefoundation/transaction/tree/master/transaction ) has all the lower level stuff that magically does the threadsafe (i think) transaction stuff -- You received this message b

Re: pyramid.security.remember and sqlalchemy model inserts

2013-07-30 Thread Jonathan Vanasco
On Tuesday, July 30, 2013 4:29:16 AM UTC-4, kusut wrote: > > do dbsession.flush(), and then the user object will have its id attr > Just to elaborate: Until a call is made to `dbSession.flush()` or `dbSession.commit()` , SqlAlchemy will (usually) not talk to the database at all. there is an

Re: stable and security upgrade

2013-08-05 Thread Jonathan Vanasco
Production and Development should really always be done on a virtualenv. I'll second the requriements.txt Debian & Ubuntu's `apt` system tends to be seriously out-of-date for Python packages , as the packages are ported to Debian and only that version is available. For example, SqlAlchemy is 0

Re: stable and security upgrade

2013-08-05 Thread Jonathan Vanasco
I needed/love virtualenv for legacy packages too. It's the only way to keep a few pylons apps with really old/specific requirements running. I usually let a few core packages drive the rest of my requirements ( for minimum versions, etc ). I keep Pyramid, SqlAlchemy and requests up-to-date --

odd random bug with specific urls 'freezing' and logging for them disabled ( dev server , waitress behind nginx )

2013-08-07 Thread Jonathan Vanasco
I spent an hour trying to figure out what was going on, no luck. i ended up restarting nginx and the problem resolved. wondering if anyone has encountered this and knows the cause. scenario: 1. in development mode, my pyramid app does `debug.log( "-- New Request %s" % path )` and then a

Re: seeking rock solid

2013-08-09 Thread Jonathan Vanasco
1. What versions Pyramid / SqlAlchemy are you using? 2. How are you grabbing a dbSession for each request ( are you calling a new `DBSession()` , and removing it at the end of the request )? 3. Are you sure you have those columns mapped in your models , not just the database ? Sorry for the du

Re: seeking rock solid

2013-08-09 Thread Jonathan Vanasco
On Friday, August 9, 2013 11:33:09 AM UTC-4, James Carroll wrote: > I'm doing the typical > DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension())) First off -- i could be wrong about this... I'm not very familiar with how the ZopeTransactionExtension works with pyra

Re: session getting stuck in error state

2013-08-09 Thread Jonathan Vanasco
> > I had been trying to recover by doing a DBSession.close at the end of each > request using > > config.add_subscriber(clearSession, NewRequest) >and where clearSession does DBSesison.close(). > i believe you want to use add_finished_callback ( http://docs.pylonsproject.org/projects/

Re: seeking rock solid

2013-08-09 Thread Jonathan Vanasco
i just want to stress that I could be wrong. It sounds like you're having problems with Transaction and Rollback. I'd dig deep into: 1. `pyramid_tm` and `transaction` + zope sqlalchemy extension 2. your use of local vs global sessions i don't use pyramid_tm but have been migrating my code to

Re: BREACH

2013-08-12 Thread Jonathan Vanasco
You have to specifically install compression middleware on Pyramid. Look in your .ini files for lines with gzip. You probably do not have this enabled, because very few people do. Here is a common setup for enabling gzip in Pyramid: http://stackoverflow.com/questions/6618985/gzipping-all-h

Re: FYI: Planning to merge some "Getting Started" docs changes today

2013-08-14 Thread Jonathan Vanasco
quick thoughts... C Extensions http://docs.pylonsproject.org/projects/pyramid/en/master/quick_tour.html#python-setup > Also, Pyramid has some optional C extensions for performance might be nice to link to which ones. Pyramid for Web Developers http://docs.pylonsproject.org/projects/pyramid

Re: Is waitress really multi-threaded?

2013-08-19 Thread Jonathan Vanasco
That's most likely an issue with your browser This: 1- edit view_1 as such: def view1(request): print 'Start view1 - %s' % id(request) time.sleep(10) print 'End view1 - %s' % id(request) return Response('Ok') 2- instead of a browser, two terminal windows that each request:

Re: Is waitress really multi-threaded?

2013-08-20 Thread Jonathan Vanasco
this is weird. Python 2.7.5 , OSX i changed your view to read: print "[%s] new request" % id(request) print "[%s] threading.active_count: %s" % ( id(request) , threading.active_count() ) I always got "1" When I added either of this lines, the number increased: print "[%s] threadi

Re: session getting stuck in error state

2013-08-21 Thread Jonathan Vanasco
ZopeTransaction just manages the transactions. pyramid_tm tells transaction to commit on non-errors ; rollback on errors. You're not using that in Production as well, are you? That sounds more like an anti-pattern than the right way to do things. On Tuesday, August 20, 2013 4:58:00 PM UTC-4,

Re: seeking rock solid

2013-08-21 Thread Jonathan Vanasco
On Wednesday, August 21, 2013 11:41:33 AM UTC-4, James Carroll wrote: > I installed postgresql and psycopg2. I had to touch up my models just a > little bit... it's picky about having unique=True on all foreign keys that > aren't primary keys > Do you mean the ForeignKey is unique within t

Re: seeking rock solid

2013-08-21 Thread Jonathan Vanasco
also, nginx+uwsgi works on ubuntu really well. -- 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 gro

Re: absolute pathnames for mako templates

2013-08-22 Thread Jonathan Vanasco
quick thought -- is the directory '/usr/local/www/' readable by the user ? i've run into issues (either in python or bash ) where a file was readable, but the enclosing folder was not, and that made the file unreadable somehow. -- You received this message because you are subscribed to the Goo

Re: weird error when updatingh webob from 1.1 to 1.2.3

2013-08-26 Thread Jonathan Vanasco
I remember WebOb and WebHelpers each having a lot of changes and backward incompatibilities. Some of the things that have caused pain for me, were changes to the MultiDict object and character encodings. Looking at the changelog... ( https://github.com/Pylons/webob/blob/master/docs/news.txt )

easiest way to set redirects in config route declaration ?

2013-08-28 Thread Jonathan Vanasco
I'm using "url dispatch" in a pyramid app. we have various url schemes that look like this: /path /path/to/a /path/to/b /path/to/c notice that `/path/to` does not exist , however `/path/to/subsections` does exist the way we're handling this now, is to create a `/path/to` in

Re: FYI: Planning to merge some "Getting Started" docs changes today

2013-08-31 Thread Jonathan Vanasco
I think of the QuickTour as an exec summary. I've gone through similar overviews in other frameworks/projects/etc been instantly in love, or will summarily dismiss it. Why? Because some overviews make it seem like you only have one option/method of getting something done ( which is true for

Re: RFC: Moving distributions/pserve up in the Quick Tour

2013-09-02 Thread Jonathan Vanasco
What if you start it and show as a single-file then - instead of throwing it out - convert the same to a package ? i.e. -- first 30% - here's pyramid basics. it's so simple we only need a single file. last 70% - typical pyramid projects can be dozens of files. let's convert our code to a pac

Re: FYI: Planning to merge some "Getting Started" docs changes today

2013-09-02 Thread Jonathan Vanasco
> Yet this is what's behind the question. They want to make sure they > don't get stuck in spaghetti-code, and "MVC" is the way they've been > taught to express this concern. You can allay this with just a > passing sentence drawing attention to the separation between the > models and the di

<    3   4   5   6   7   8   9   10   11   12   >