Re: are there still pylons eggs available?
On Aug 8, 8:17 am, Petr Blahos petrbla...@gmail.com wrote: I'm trying to install Pylons using easy_install, but the installation egg does not seem to be available. bash-4.2$ ./easy_install Pylons=1.0 Searching for Pylons=1.0 Readinghttp://pypi.python.org/simple/Pylons/ Readinghttp://www.pylonshq.com/ Download error: [Errno 110] Connection timed out -- Some packages may not be found! Works for me. Can you easy_install anything else? Aren't you behind some evil proxy? Hmmm, it's working for me, but it's very slow. Takes The 1.0 download link is missing from http://pylonsproject.org/projects/pylons-framework/download There's also no 1.0 tag in either the tree on github or bitbucket. Also, is there really a 1.0.1 around? See http://docs.pylonsproject.org/projects/pylons_framework/dev/upgrading.html#id2 Ross -- 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. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Re: webhelpers.html.tags.select and disabled
On Wed, 2011-07-20 at 09:58 -0700, Mike Orr wrote: On Tue, Jul 19, 2011 at 3:20 PM, Ross Vandegrift r...@kallisti.us wrote: Any reason why select() doesn't support taking disabled as a keyword args like the other input tags? Looking at the source, the text helper does have a 'disabled' option (keyword-only arg), so I could implement that in all the input helpers if there's no objection. (select, radio, textarea, etc) That sounds perfect to me - it's very simple and gives all of those helpers the same behavior. Ross signature.asc Description: This is a digitally signed message part
webhelpers.html.tags.select and disabled
Hi all, Any reason why select() doesn't support taking disabled as a keyword args like the other input tags? Is something like the below desirable? (Not actually very tested...) Thanks, Ross diff -r acfb17881c1c webhelpers/html/tags.py --- a/webhelpers/html/tags.py Thu Mar 24 02:23:48 2011 -0700 +++ b/webhelpers/html/tags.py Tue Jul 19 18:19:39 2011 -0400 @@ -343,12 +343,17 @@ list: (, ``prompt``). This is intended for those Please choose ... pseudo-options. Its value is , equivalent to not making a selection. +* ``disabled`` - If set to True, the user will not be able to use +this input. + Any other keyword args will become HTML attributes for the select. Examples (call, result):: select(currency, $, [[$, Dollar], [DKK, Kroner]]) literal(u'select id=currency name=currency\\noption selected=selected value=$Dollar/option\\noption value=DKKKroner/option\\n/select') + select(currency, $, [[$, Dollar], [DKK, Kroner]], disabled=True) +literal(u'select disabled=disabled id=currency name=currency\noption selected=selected value=$Dollar/option\noption value=DKKKroner/option\n/select') select(cc, MasterCard, [ VISA, MasterCard ], id=cc, class_=blue) literal(u'select class=blue id=cc name=cc\\noption value=VISAVISA/option\\noption selected=selected value=MasterCardMasterCard/option\\n/select') select(cc, [VISA, Discover], [ VISA, MasterCard, Discover ]) @@ -364,6 +369,7 @@ _set_id_attr(attrs, id, name) attrs[name] = name convert_boolean_attrs(attrs, [multiple]) +convert_boolean_attrs(attrs, [disabled]) # Accept None as selected_values meaning that no option is selected if selected_values is None: selected_values = ('',) signature.asc Description: This is a digitally signed message part
Re: Authentication and Authorization.
On Fri, Aug 20, 2010 at 10:36:41AM -0700, Mike Orr wrote: Many people find a homegrown scheme adequate, and easier than repoze.who/what, especially if you're using a login form and have a relatively simple permissions structure.Some people have tried to make a general library, but the use cases are so varied that it ends up being as complicated as Repoze or AuthKit. I second this - one of us that maintains homegrown AA should write up a quick howto some Friday afternoon... here goes: http://wiki.pylonshq.com/display/~ejf/Example+homegrown+authentication+and+authorization Suggestions / pointing out problems would be more than welcome. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: python2.6 and WebError?
On Tue, Jul 06, 2010 at 07:53:04AM +0530, b vivek wrote: Hi can I have a look at the search_function of /usr/lib/python2.6/encodings/__init__.py. Here you go: http://pastebin.com/KUrcs1Qh As far as I know, it's stock with my Python distribution. The exception in the traceback occurs on line 30 of the paste above. Ross On Mon, Jul 5, 2010 at 11:00 PM, Ross Vandegrift r...@kallisti.us wrote: Hey everyone, Looks like Debian recently changed the system python to python2.6, so I'm taking this chance to update my app to make sure there aren't any issues. When I hit a page via paster serve ... I get a weird exception from imports in WebError. Has anyone seen this? I can't be the first person to try to run on python2.6! I tried rolling back to WebError 0.10.1 (which I was using without issue on python2.5), but it didn't help. Thanks, Ross Exception happened during processing of request from ('127.0.0.1', 39433) Traceback (most recent call last): File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 1068, in process_request_in_thread self.finish_request(request, client_address) File /usr/lib/python2.6/SocketServer.py, line 322, in finish_request self.RequestHandlerClass(request, client_address, self) File /usr/lib/python2.6/SocketServer.py, line 617, in __init__ self.handle() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 442, in handle BaseHTTPRequestHandler.handle(self) File /usr/lib/python2.6/BaseHTTPServer.py, line 329, in handle self.handle_one_request() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 437, in handle_one_request self.wsgi_execute() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 287, in wsgi_execute self.wsgi_start_response) File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/cascade.py, line 130, in __call__ return self.apps[-1](environ, start_response) File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/registry.py, line 375, in __call__ app_iter = self.application(environ, start_response) File /usr/local/lib/python2.6/dist-packages/Pylons-0.9.7-py2.6.egg/pylons/middleware.py, line 201, in __call__ self.app, environ, catch_exc_info=True) File /usr/local/lib/python2.6/dist-packages/Pylons-0.9.7-py2.6.egg/pylons/util.py, line 94, in call_wsgi_application app_iter = application(environ, start_response) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 235, in __call__ return self.respond(environ, start_response) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 483, in respond return debug_info.content() File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 539, in content self.base_path, self.counter, self.libraries) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 657, in format_eval_html short_er, extra_data = short_formatter.format_collected_data(exc_data) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 73, in format_collected_data importance, title, value) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 345, in format_extra_data return self.zebra_table(title, value) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 377, in zebra_table % self.quote(title)] File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 295, in quote s = s.encode('latin1', 'htmlentityreplace') File /usr/lib/python2.6/encodings/__init__.py, line 100, in search_function level=0) TypeError: import_module() got an unexpected keyword argument 'level' -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkwyFscACgkQMlMoONfO+HAufQCgwDhpOxPjgfqcquy2C2YBMsHs yQ0AoIkPgng0SvRK13OChhkUUZDnYlHP =fqqQ -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en. -- Ross Vandegrift r
Pylons 0.10 and Myghty
Hi everyone, Working through an upgrade from 0.9.7 - 0.10 and can't quite figure out how to integrate Myghty. I'd love to move ot Mako, but refactoring and translating 6k lines of messy templates isn't really an option. I looked over pylons.templating and I'm kinda over my head in understanding what I need to do to have a render_myghty. Anyone else using Myghty with 0.10? Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
python2.6 and WebError?
Hey everyone, Looks like Debian recently changed the system python to python2.6, so I'm taking this chance to update my app to make sure there aren't any issues. When I hit a page via paster serve ... I get a weird exception from imports in WebError. Has anyone seen this? I can't be the first person to try to run on python2.6! I tried rolling back to WebError 0.10.1 (which I was using without issue on python2.5), but it didn't help. Thanks, Ross Exception happened during processing of request from ('127.0.0.1', 39433) Traceback (most recent call last): File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 1068, in process_request_in_thread self.finish_request(request, client_address) File /usr/lib/python2.6/SocketServer.py, line 322, in finish_request self.RequestHandlerClass(request, client_address, self) File /usr/lib/python2.6/SocketServer.py, line 617, in __init__ self.handle() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 442, in handle BaseHTTPRequestHandler.handle(self) File /usr/lib/python2.6/BaseHTTPServer.py, line 329, in handle self.handle_one_request() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 437, in handle_one_request self.wsgi_execute() File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/httpserver.py, line 287, in wsgi_execute self.wsgi_start_response) File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/cascade.py, line 130, in __call__ return self.apps[-1](environ, start_response) File /usr/local/lib/python2.6/dist-packages/Paste-1.7.4-py2.6.egg/paste/registry.py, line 375, in __call__ app_iter = self.application(environ, start_response) File /usr/local/lib/python2.6/dist-packages/Pylons-0.9.7-py2.6.egg/pylons/middleware.py, line 201, in __call__ self.app, environ, catch_exc_info=True) File /usr/local/lib/python2.6/dist-packages/Pylons-0.9.7-py2.6.egg/pylons/util.py, line 94, in call_wsgi_application app_iter = application(environ, start_response) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 235, in __call__ return self.respond(environ, start_response) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 483, in respond return debug_info.content() File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 539, in content self.base_path, self.counter, self.libraries) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/evalexception.py, line 657, in format_eval_html short_er, extra_data = short_formatter.format_collected_data(exc_data) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 73, in format_collected_data importance, title, value) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 345, in format_extra_data return self.zebra_table(title, value) File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 377, in zebra_table % self.quote(title)] File /usr/local/lib/python2.6/dist-packages/WebError-0.10.2-py2.6.egg/weberror/formatter.py, line 295, in quote s = s.encode('latin1', 'htmlentityreplace') File /usr/lib/python2.6/encodings/__init__.py, line 100, in search_function level=0) TypeError: import_module() got an unexpected keyword argument 'level' -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: Pylons and performance
On Sun, Jun 20, 2010 at 02:05:50PM -0500, gary clark wrote: The below is from running MTR for windows. I am starting to think this is problem is intermittent. Turn off your bittorrents :) See how the packet loss starts from the very first hop? That indicates that the issue is on your end, not the server end. The most common cause of that kind of packet loss would be link saturation. Ross |--| | WinMTR statistics | | Host - % | Sent | Recv | Best | Avrg | Wrst | Last | ||--|--|--|--|--|--| | 192.168.0.1 -0 | 394 | 394 |0 |0 | 16 |0 | | 99.28.211.254 - 37 | 394 | 252 |0 |9 | 31 | 16 | | dist2-vlan60.stl2mo.sbcglobal.net - 42 | 394 | 231 |0 |9 | 16 | 16 | | bb2-g0-0.stl2mo.sbcglobal.net - 41 | 394 | 234 |0 | 14 | 188 | 15 | | 151.164.99.189 - 46 | 394 | 216 | 15 | 34 | 234 | 15 | |te7-2.ccr02.ord03.atlas.cogentco.com - 48 | 393 | 206 | 15 | 21 | 203 | 16 | |te0-2-0-1.ccr22.ord01.atlas.cogentco.com - 44 | 393 | 224 | 15 | 16 | 32 | 31 | |te0-0-0-6.ccr22.yyz02.atlas.cogentco.com - 41 | 393 | 232 | 31 | 31 | 47 | 31 | |te4-4.mpd02.yyz02.atlas.cogentco.com - 58 | 393 | 167 | 31 | 36 | 188 | 31 | |38.117.92.82 - 47 | 393 | 209 | 31 | 57 | 844 | 31 | | 69-10-224-202.onx.com - 50 | 393 | 198 | 31 | 32 | 47 | 31 | | 69-10-224-220.onx.com - 52 | 393 | 192 | 31 | 32 | 47 | 31 | | 74-213-166-67.ultrahosting.com - 44 | 393 | 221 | 31 | 32 | 141 | 31 | ||__|__|__|__|__|__| WinMTR - 0.8. Copyleft @2000-2002 Vasile Laurentiu Stanimir ( stani...@cr.nivis.com ) Still frustrated. Cheers, Gazza On Sun, Jun 20, 2010 at 1:13 PM, Ross Vandegrift r...@kallisti.us wrote: On Sat, Jun 19, 2010 at 02:16:42PM -0700, cd34 wrote: I did a quick run of ab, several requests came in at 3.1 seconds. I don't know what sort of network they are running, but 3 seconds seems very similar to an arp table rebuild in certain switches. When enough machines are put on a network, it overflows the 8192 record tcam (or whatever the limit is on that switch), which causes it to need to rebuild the arp tree as it rediscovers. Until each machine is rediscovered, they are basically 'off-net'. Such ARP table exhaustion would typically be steady-state in a datacenter environment - a complete and total meltdown, never recoverging. 3 seconds wouldn't be nearly enough time for such a thing to wring out. Also, TCAM isn't used for ARP entries - lots of things are stored in TCAM, but ARP isn't one of them. I'd file a trouble ticket with them and let them know that you are seeing packet loss into their network and that you are seeing timeouts on requests going to your server and see what they say. I don't think your issue is software related - I agree that it looks like it is network related. If you opt to contact their support department, provide a traceroute from your problamtic location to the destination that shows either failing traceroutes or extended delays at the LAST HOP (the intermediate hops don't matter). MTR is a nice program for generating nice reports of this, but some NOCs want classic traceroute output. I don't see any evidence of a network issue, unless you were able to measure the 6% packet loss only at the time of HTTP impact. I'm not seeing any packet loss to 74.213.166.67 from my location, but it appears that the HTTP service is stopped now. Are you hosting on a virtualized platform? I'd be suspicious of platform performance issues. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkweWlQACgkQMlMoONfO+HDgugCfWATMenhPQbC+v/F8c6yG5I+P NL4AnA7ZlXJy4kQpolujpZawMxzhskXD =1keh -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en. -- Ross
Re: Pylons and performance
On Sat, Jun 19, 2010 at 02:16:42PM -0700, cd34 wrote: I did a quick run of ab, several requests came in at 3.1 seconds. I don't know what sort of network they are running, but 3 seconds seems very similar to an arp table rebuild in certain switches. When enough machines are put on a network, it overflows the 8192 record tcam (or whatever the limit is on that switch), which causes it to need to rebuild the arp tree as it rediscovers. Until each machine is rediscovered, they are basically 'off-net'. Such ARP table exhaustion would typically be steady-state in a datacenter environment - a complete and total meltdown, never recoverging. 3 seconds wouldn't be nearly enough time for such a thing to wring out. Also, TCAM isn't used for ARP entries - lots of things are stored in TCAM, but ARP isn't one of them. I'd file a trouble ticket with them and let them know that you are seeing packet loss into their network and that you are seeing timeouts on requests going to your server and see what they say. I don't think your issue is software related - I agree that it looks like it is network related. If you opt to contact their support department, provide a traceroute from your problamtic location to the destination that shows either failing traceroutes or extended delays at the LAST HOP (the intermediate hops don't matter). MTR is a nice program for generating nice reports of this, but some NOCs want classic traceroute output. I don't see any evidence of a network issue, unless you were able to measure the 6% packet loss only at the time of HTTP impact. I'm not seeing any packet loss to 74.213.166.67 from my location, but it appears that the HTTP service is stopped now. Are you hosting on a virtualized platform? I'd be suspicious of platform performance issues. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: Does your company use Pylons?
On Mon, May 24, 2010 at 04:08:35PM -0700, Ben Bangert wrote: If you're not already on the list of Sites Using Pylons, and think can get approval for the use of your logo as a company using Pylons, feel free to email me directly as b...@groovie.org. Are you interesting in folks using Pylons only in internal-facing applications? We have a number of critical pieces of internal services running on Pylons, but none of it will ever be user-visible. If so, I'll talk to my boss and the marketing folks to clear it. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: Best way to write command line / batch tools?
On Fri, Feb 26, 2010 at 11:17:58AM -0800, DD wrote: Hi, I am trying to figure out what would be the best way to write batch (command line) tools in pylons. Basically, what I need is a replica of the configuration that my live site uses, but instead of controllers getting the requests, its a command line tool. Everything else (globals, caching, database, etc) should be the same. I looked at the command line utilities section in pylons documentation, but I can't seem to figure out how to everything loaded properly. loadapp() gives me an instance of the app that can be passed on to a wsgi server, but that's not what I was looking for. Another option will be to just run a paster serve and write a controller, but that doesn't seem to be the right way to do things :(. What's the best approach to do this? You can add an entry point to add paster commands that will work with your app loaded. This requires a bit of hackery, but is pretty simple. First, I make a directory project/project/commands. Second, add an entry point in setup.py: entry_points= [paste.app_factory] main = project.config.middleware:make_app [paste.app_install] main = pylons.util:PylonsInstaller [paste.paster_command] MyIsh= project.commands.MyIsh:MyIsh , Third, I follow http://pythonpaste.org/script/developer.html to make a command. It basically has to be kinda like this: from paste.script.command import Command from paste.deploy import appconfig from pylons import config from project.config.environment import load_environment class MyIsh(Command): def command(self): conf = appconfig('config:%s' % yourconfigfile) load_engironment(conf.global_conf, conf.local_conf) '''do your stuff''' Fourth, I run it like paster MyIsh or paster --plugin=project MyIsh Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: writing to g/app_globals -- is it safe for caching info after startup ?
On Feb 8, 12:20 pm, Jonathan Vanasco jonat...@findmeon.com wrote: i have some data that I cache on startup -- mostly config info and misc database intensive stuff. i need to reload every so often. is it safe to reload it into g ? or should i cache this in memcached or similar ? Have you tested this at all? I too am thinking about using g to do a global cache. My objects can't be pickled - they are associated with long- running TCP sessions and need to ensure exclusive access between threads. I could write a standalone app to hold connections open and mediate access, but since I have app_globals Anyone have comments on the safety of this, from Pylons's point of view? Ross -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
Re: writing to g/app_globals -- is it safe for caching info after startup ?
On Tue, Feb 09, 2010 at 07:19:45AM -0800, Damian wrote: app globals is not thread safe - if you write to it concurrently you will be in trouble. I keep a lot of stuff in app globals that is set on startup and never changed. If you need a cache use something like memcached - that works very well, and is easy to use. I can recommend doing this through beaker as it has nice features such as dog-pile-effect prevention for when your cache expires. If you cannot use memcached you can use other backends interchangably with beaker. My objects aren't picklable or hashable - they have live TCP sessions. This means they can't be stored in beaker or memcached. I have to have sockets hang around in some globally accessible memory. Not being threadsafe isn't the end of the world for me. I've just hacked up a basic per-entry locking dictionary for my objects and it seems to behave nicely in app_globals. I'm concerned about bugs throwing exceptions in critical sections. In that case, I'll probably leak the mutex hold, which means subsequent actions will fail. Guess I need to fix all the bugs :) -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: writing to g/app_globals -- is it safe for caching info after startup ?
On Tue, Feb 09, 2010 at 03:15:05AM -0800, P?teris Caune wrote: One thing to keep in mind is that if you'll deploy your webapp with Apache and mod_wsgi, there will be multiple processes running you app, and each one will have g object with its own cache. So a bit of memory wasted and possible data integrity issues: request A gets served by process A and updates/invalidates A cache , request B gets served by process B, assumes up-to-date cache but gets stale data. So in that setting cache should be stored somewhere external where it can be shared among processes. Like memcached or files. Ah crap - I didn't even think of that. That's what I get for developing on an environment that's different than production! Guess I'm stuck putting together a standalone server process to handle this. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: writing to g/app_globals -- is it safe for caching info after startup ?
On Tue, Feb 09, 2010 at 11:12:44AM -0800, Ben Bangert wrote: Any details on what exactly you need to hold open? :) My app manages various network devices, some of which require connecting via ssh. Currently, my app connects on request to retrieve data from the network. Key negotiation and TCP handshake can take enough time to really add latency to user requests currently do. Devices that use SNMP don't suffer from these performance problems since you can get to data as soon as you want. I was setting a pool of idle connections that client requests could lock and use for their operations before returning them to the pool. I think you're right that moving this cache into a seperate app is the right way to go. I've done exactly this for similar issues, so it's not an unfamiliar pattern. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: writing to g/app_globals -- is it safe for caching info after startup ?
On Tue, Feb 09, 2010 at 11:57:08AM -0800, Mike Orr wrote: But connections to external resources don't use much memory and they wouldn't be updated simultaneously anyway. It's not the efficiency I care about, in my case it's correctness. If two processes have different copies of the model objects, the two processes can each acquire locks on their local copy and think that they are acting exclusively. Now each process starts making changes on the network without realizing that they could be screwing each other up! Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: Pylons and emacs tips
On Tue, Jan 05, 2010 at 10:50:17AM -0800, karikris...@gmail.com wrote: 1. I often found missing the debug feature closely like Visual Studio. I can't speak to this since I don't know what this Visual Studio feature does. I don't run any python debuggers from Emacs. For that matter, I tend not to use the python debugger. 2. I am not sure how to use the mako syntax high lighting in emacs My emacs customization is pretty thin: You want to use mmm-mako. Copy mmm-mako.el to: $emacs/site-lisp/mmm-mako/ And put this into your .emacs: (load-library mmm-mako) (add-to-list 'auto-mode-alist '(\\.mako\\' . html-mode)) (mmm-add-mode-ext-class 'html-mode \\.mako\\' 'mako) There's no support for Mako (I still have a lot of mako templates). I just use html-mode: (add-to-list 'auto-mode-alist '(\\.myt\\' . html-mode)) I also like to enable javascript-mode for .js: (autoload 'javascript-mode javascript nil t) (add-to-list 'auto-mode-alist '(\\.js\\' . javascript-mode)) 3. I run the paster shell on terminal (outside emacs, use gedit to view the log file) Me too - I prefer to use ipython in a terminal to running inside emacs. I don't know if there is a key combo to launch paster shell in an emacs shell, but in general, I don't like emacs shell. Emacs grabs too many Control key combos! -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: CAS authentication.
On Wed, Dec 16, 2009 at 04:53:49PM +0100, Thomas Bellembois wrote: What is the best way to user CAS authentication with Pylon ? I tried to use pycas (http://www.ja-sig.org/wiki/display/CASC/Pycas) putting the four lines in one of my controllers but this led to server errors. I never found an easy to use, ready to go Python module. It was pretty easy to roll my own - CAS is pretty trivial. I have an authentication controller that users are redirected to if they do not have a properly authenticated session. The CAS interaction looks like: - if not request.params.has_key(ticket): url = %s/login?service=%s % (config.get('casurl'), urllib.quote(config.get('appurl'))) return redirect(url, code=307) else: url = %s/validate?service=%sticket=%s % (config.get('casurl'), urllib.quote(config.get('appurl')), request.params[ticket]) (response, username) = urllib.urlopen(url).readlines() if response.strip() == no: url = %s/login?service=%s % (config.get('casurl'), urllib.quote(config.get('appurl'))) return redirect(url, code=307) - In my config, the variables look like this: casurl = https://cas-host/ appurl = https://myapp/auth/ If the user passes CAS and falls through the above code, my app sets them up a session with the appropriate authorization details. On the official CAS server, you'll need to do a bit more elaborate parsing of the response - the above works with RubyCAS, which implements different responses. Authorization is then done with the username against an LDAP directory. CAS is purely for authentication. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: Authentication Authorization for multiple apps?
On Wed, Dec 16, 2009 at 08:13:39AM -0800, flzz wrote: Greetings all, my company is currently in the process of migrating to python + pylons as our development platform of choice. We currently have a good bit of traffic to support and to help ease maintenance and operation overheads we will be creating multiple pylons applications to service certain aspects of our application on the whole. To the question. Is it possible to have a single Authentication and Authorization model (repoze.who repoze.what) that is shared among multiple pylons applications? We currently utilize the debian packaging system (Ubuntu) to handle software deployment, so the approach I can see us taking is to abstract out the AA portion of the system into its own package (deb/egg). Then from that point we will create our own pylons template that includes the use of this system. Am I off base with this approach at all? it seems uniformity of WSGI and the modular nature of pylons should make this doable. What I've done is integrate CAS into my pylons app as a replacement for any kind of local authentication. CAS handles user sign in, and supposing that you accomodate it well into your applications, will automatically grant authenticated access to users across applications. This gives nice single sign on for many apps, including diverse application servers and stacks. This leaves authorization and session setup issues to the application. Having shared sessions sounds elegant, but difficult. Check out the message I just posted in CAS Authentication for the details on how I integrated. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Form fields and the back button
Hi everyone, Back in the days of Pylons 0.9.5, if you incorrectly filled out a form in my app, submitted it, got an error, and then pressed the browser back button, you would always get a copy of the form pre-filled with the values that were there when it was submitted. At some point since then, something changed. I don't know if it's Pylons, Firefox, or Apache. Now, there's two cases: 1) When my app runs under paster, it always behaves as above. So in my development environment, I can hit back, correct one field in a form, and resubmit. Great! 2) When my app runs in production, under Apache+fcgi, pressing back always gives a blank form. A few of the guys in the office have spent a bit looking at this (they're the ones mostly affected, heh). We've looked through a few things: The HTTP headers from Paster and Apache are identical, the HTTP headers sent from the client are identical. The behavior is consistent across multiple browsers and platforms (IE and Firefox on Windows, Firefox on Ubuntu/Debian/Fedora). Anyone have any ideas on what is causing this or what I can do to make it not clear the form fields? -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Generic routes for API functions
Hi everyone, I'm adding API functionality to an exiting app whose controller actions aren't close to being in shape for direct exposure. This pretty much precludes me from turning them into REST controllers and accomplishing this task that way. So I've created a new api controller that will house the actions for programmatic access. This has an unfortunate side effect of making my routing kind of difficult. For example, suppose I have model objects X and Y and the following API: class ApiController(BaseController): @jsonify def getXbyid(self, id): q = meta.session.query(model.X) result = q.get(id) return {result: result.__json__()} @jsonify def getXbyacct(self, acct): q = meta.session.query(model.X) result = q.filter_by(acct=acct).one() return {result: result.__json__()} @jsonify def getYbyname(self, name): q = meta.session.query(model.Y) result = q.filter_by(name=name).one() return {result: result.__json__()} How can I effectively map these actions without listing each action in my routes? The best I have come up with is to include a route for each parameter name I use: map.connect(/api/{action}/{id:[0-9]+}, controller=api) map.connect(/api/{action}/{acct:[0-9]+}, controller=api) map.connect(/api/{action}/{name:[a-zA-Z0-9+}, controller=api) -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Rendering text to an image?
Hello everyone, Does anyone have a suggestion of an easy way to render text to an image of a given size? The tutorial on pylonshq.org [1] uses Matplotlib to generate plots, but I really need to be able to include an error message in a generated image. I've looked at PIL, which is mentioned at [1], but it's unruly, requires me to ship my own fonts, and the color controls for rendered text don't seem to work. Anyone have a good tip? [1] http://wiki.pylonshq.com/display/pylonscookbook/Adding+graphical+output -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie signature.asc Description: Digital signature
Re: user management (login, registration, etc.)
On Mon, Aug 31, 2009 at 10:57:14AM -0700, Wyatt Baldwin wrote: On Aug 31, 7:59 am, Ross Vandegrift r...@kallisti.us wrote: On Mon, Aug 31, 2009 at 05:19:58AM -0700, Graham Higgins wrote: At some point in the not-too-distant, if interest warrants, I will complete some of the more complex templates that I have lined up: using eXist a native XML database, a basic SOAP template and an AtomPub/XMPP template. Consider this a vote for a SOAP template. Despite trying half a dozen times, I cannot make heads or tails of Python and SOAP. ZSI appears to be the library of choice, but I can't begin to figure out what I'm supposed to do with it. A template to pick apart would be amazing! Have you seen Suds? I chose that over ZSI for a SOAP project last year. I wasn't able to use Suds when I used it last because one of the SOAP APIs I might use requires HTTP authentication on every request. It looks like Suds has recently grown this capability though, which makes potentially makes it a good choice. Barring the HTTP Auth requirement, I've actually had pretty good luck as a SOAP client. I'm more concered about providing SOAP services. That's the piece that I've never even got off the ground. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Pylons marketing, ( new thread from web tech )
On Sat, Aug 22, 2009 at 11:37:38AM -0700, Noah Gift wrote: 1. Read The Fountainhead and actually took it seriously. Wow. Thankfully, I'm not aware of any ridiculous moral association between my favorite web development framework and one of my least favorite members of the American pseudo-intellectual tradition. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Using Multiple Databases (SQLALCHEMY)
On Sat, Aug 01, 2009 at 05:13:23AM -0700, RossC wrote: I've just started researching and prototyping with pylons and sqlalchemy and have a question that I'm sure can be answered quickly. My project has the requirement to connect to a central db, get a second connections details from that central database and then open another connection to that specified connection. Do you need to maintain the original connection, or is it merely a broker for the actual connection? If you don't need it, have your function that sets up the model replace the metadata and sessionmaker with new ones from the second connection. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Web technologies and pylons in the real world
On Wed, Jul 22, 2009 at 06:23:50PM -0700, Ben Bangert wrote: Hmm, yes, that is true. What do you think would be the best way? Blog posts? I'm just unsure of what to say, should I just put a new post up now and then saying, We're not dead, really! ? I have the benefit of seeing and using many free software projects over the years, so my perspective may be slanted. The number one indicator I use is community activity. The fact that pylons has a mailing list with people discussing technical items and adminstrative details screams out loud about the activity of the project! We did update the web page to have news that keeps it a bit more current than the old one. If other people would like posting ability to the PylonsHQ news blog, to announce sites using Pylons, new things, etc. I'd be happy to permit more people to post there. Any volunteers? :) What about a thing that displayed the five most recent thread titles from the mailing list and the dates of the messages? Brings the groups discussion to the forefront without adding the burden of constantly coming up with news worth writing/reading about. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: deploying to production?
On Wed, May 20, 2009 at 02:28:52PM +0100, Chris Withers wrote: - which bits of a Pylons project do you version control? * I version control anything that isn't automatically regenerated. That includes the Paster templates and boilerplate code (since it's rarely boilerplate when I'm done!) - how do you build all the other bits? * I push my releases to a git repository that is accessible from my production server where I checkout and build an egg in the production virtualenv. For a long time, I built out of my working directly, but a recent feature mis-merge broke me of that bad habit :). - what do people use to serve their sites? Is whatever paster serve blah.ini using suitable for serving to the wide world or does it need to be proxied through something like Apache? - if using paster serve, how do people wire it so that it starts at machine startup and stops at machine shutdown? - is paster serve the recommended option? If not, what is? I'd say I seem to be in the minority, based on the discussions here, but I use Apache+FastCGI. Never have any deployment problems. I restart Apache when I deploy a new version, which might annoy some people (I could kill my fcgi processes, but just don't usually bother). I do try to be the first hit so I see the initial load time! * I'd like to be using buildout for things wherever possible, the following is what I have so far: I have not used buildout, so I can't really comment. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: ProfileMiddleware problem?
On Tue, Apr 28, 2009 at 07:17:17PM -0500, Ian Bicking wrote: I think there's been some changes to the middleware and to the Python profiling module, which may be leading to this (older versions of Python required replacing sys.stdout to capture the profiling output, later versions stopped requiring this hack). Maybe you changed your Python version? Or upgraded Paste and are still using an older Python version. Yep, my app has thus far remained on Python 2.4, though I've followed any subsequent Paste updates required by Pylons. Like I said, I don't actually need the profiler right now, just something I noticed. So good to know from the other poster that there are alternatives I could explore. Also, would be relatively easy for me to upgrade Python on my devel environment, should I need to profile. Thanks, Ross On Tue, Apr 28, 2009 at 3:36 PM, Ross Vandegrift r...@kallisti.us wrote: Hey everyone, I noticed when shuffling between config files that my profiling setup is busted. In my middleware.py: # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) if config.get('profile'): from paste.debug.profile import ProfileMiddleware app = ProfileMiddleware(app, global_conf) I used to get a yellow div at the bottom of the screen with the paster profiling output. Now, I get an empty yellow div and the profiling data goes to the console. This isn't any major deal - just an oddness I noticed. Is there something I need to change to use ProfileMiddleware? -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie -- Ian Bicking | http://blog.ianbicking.org -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
ProfileMiddleware problem?
Hey everyone, I noticed when shuffling between config files that my profiling setup is busted. In my middleware.py: # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares) if config.get('profile'): from paste.debug.profile import ProfileMiddleware app = ProfileMiddleware(app, global_conf) I used to get a yellow div at the bottom of the screen with the paster profiling output. Now, I get an empty yellow div and the profiling data goes to the console. This isn't any major deal - just an oddness I noticed. Is there something I need to change to use ProfileMiddleware? -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: updating database schema
On Wed, Apr 22, 2009 at 12:36:09AM -0700, Richard Jones wrote: Is there a way to access the database directly, so that I can manually re-jig the database. Or do I have to provide an update script each time i change the schema? (and if so, how?) I have a very low-tech solution. I never use table reflection, all table layouts are explicit in my code. If I deploy a new version that requires schema changes and forget to update the database schema manuall, Pylons will throw me an error on any hit since the model won't be able to load. :) Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment in a hosted environment
On Mon, Apr 06, 2009 at 04:52:27PM -0700, edgarsmolow wrote: I've never used plesk The issue is not just not using a GUI. The hosting company provides valuable services (for surprisingly little money) that we would otherwise have to do ourselves (a real cost to our company). In order to run a Pylons application, is it necessary to manage the box ourselves? If so, I wish I had known that beforehand. If your host is resistant to supporting mod_wsgi or reverse proxies, see if you get FastCGI support. Pylons runs great under FastCGI, and it's a bit more routine of a thing to have installed. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: can multiple config files be read / or included ?
On Mon, Mar 23, 2009 at 03:50:39PM -0700, Wyatt Baldwin wrote: In my development.ini, I have this: [app:main] use = egg:ipdbsite use = config:ipdbsite.ini In ipdbsite.ini, I have: [app:main] use = egg:ipdbsite var1 = 1 ... Just a little nit to pick: I don't think you need the `use = egg:ipdbsite` in development.ini. Yep, that appears correct. I guess the last file needs to supply the loader that paster complains is missing if you leave that out of the use'd file? BTW, have you figured out how to inherit an *entire* config file, or can it only be done per section? I didn't realize until you just pointed that out that I'm probably not inheriting the entire file :). It just happens to be that I've only got a single section in the included config. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: can multiple config files be read / or included ?
On Mon, Mar 23, 2009 at 09:39:01AM -0700, Jonathan Vanasco wrote: This ended up giving me some more questions than answers. Can anyone give me an overview of how this works? The ConfigParser docs are pretty bad. When I do the use = directive, paster starts throwing errors It took me a while to stumble through a similar refactoring of my config files. The reason seems to be that there's a certain minimum of stuff you need in an .ini file for it to work as a paster config - being syntactically valid isn't enough. In my development.ini, I have this: [app:main] use = egg:ipdbsite use = config:ipdbsite.ini In ipdbsite.ini, I have: [app:main] use = egg:ipdbsite var1 = 1 ... Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Disabling unicode doesn't always disable unicode in 0.9.7
On Mon, Mar 09, 2009 at 01:15:35PM -0700, Philip Jenvey wrote: Anyway, if it doesn't work in paster, I would concentrate on isolating the problem there, locally. However I'm unable to reproduce the issue with 0.9.7. Are you using 0.9.7 final? This may have been a bug in one of the earlier RC/betas. I think you're right about an earlier release. I updated my dev virtualenvs to 0.9.7 final and things seem better. Also looks like a changed was made in the latest release of google protocol buffers (which I use for RPC) that changed the way data gets loaded from the wire. Whereas the pyhon library used to only use Unicode types for representing data that required it, it seems this was a bug. As a result, I think all kinds of weird stuff was being injected. Things seem okay on the Pylons side of the fence now! Sorry for the noise, Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Disabling unicode doesn't always disable unicode in 0.9.7
On Fri, Mar 06, 2009 at 03:17:55PM -0800, Philip Jenvey wrote: On Mar 6, 2009, at 2:34 PM, Ross Vandegrift wrote: I've got: config['pylons.request_options']['charset'] = None config['pylons.response_options']['charset'] = 'iso-8859-1' in my config/environment.py. This should work: config['pylons.request_options']['charset'] = None Right, it should work. But it doesn't :) It worked fine on 0.9.6, it's just since my upgrade to 0.9.7 that its stopped doing the trick. You can check request.charset later for what this is actually set to. Only the value of None should disable unicode (US-ASCII won't). Okay - I tried US-ASCII just for kicks, but None is what I'm using. Any chance that specifying the response_options is confusing something? Another thing is that the method of deployment seems to affect this bug. When I'm developing with paster, all kinds of things crap out because of Unicode data being passed up the stack. In my live deployment (which uses Apache and FastCGI) this doesn't seem to be a problem. Is is possible that paster is doing something terrible in my development environment (like coercing my requests into a different character set)? Maybe I'll get a staging version of the Apache/FCGI set up so I can see what request.charset looks like in that setup. Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Disabling unicode doesn't always disable unicode in 0.9.7
On Fri, Mar 06, 2009 at 03:17:55PM -0800, Philip Jenvey wrote: This should work: config['pylons.request_options']['charset'] = None Maybe you don't have this line at the end of the environment.py? It should come after config.init_app You can check request.charset later for what this is actually set to. Only the value of None should disable unicode (US-ASCII won't). Yea, something is definitely incorrect with disabling Unicode handling. I've setup a matching Apache/FCGI deployment with config['pylons.request_options']['charset'] = None. If I raise an Exception and print request.charset in the debug interface, I get 'utf-8'. I can confirm with LiveHTTPHeaders that my browser is not providing a Content-Type header that would be overriding the default character set. The tickets section of pylonshq.com seems to be throwing 404s - else I'd see about throwing this in there. Thanks, Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Disabling unicode doesn't always disable unicode in 0.9.7
Hi everyone, One of my app's primary functions is to speak SNMP to routers and switches. This completely precludes the use of any Unicode - something that's getting very frustrating in Python (not just Pylons!) I've got: config['pylons.request_options']['charset'] = None config['pylons.response_options']['charset'] = 'iso-8859-1' in my config/environment.py. But I still have request.params being passed up the stack with everything as Unicode. Here's one example: UnicodeMultiDict([('location', u'2'), ('domain', u'2'), ('hostcount', u'6'), ('customer', u'a'), ('type', u'2'), ('description', u'a'), ('ttype', u'srt'), ('nexthop', u'172.16.0.4'), ('vlanmethod', u'auto'), ('vlan', u'0'), ('interface', u'Vlan99')]) I didn't see this behavior until 0.9.7. I've also tried setting config['pylons.request_options']['charset'] = US-ASCII, but the data comes through the same. According to [1], the config/environment.py value is overridden by the browser's Content-Type header. From wireshark, I can see that my browser is sending Content-Type: application/x-www-form-urlencoded - I don't see any mention of UTF-8 encoding there, but I don't totally know what that means. What's more perplexing is that despite the environment.py settings to use ISO-8859-1, and my HTML settings that are shipping ISO-8859-1, PasteServer's HTTP headers still say Content-Type: text/html; charset=UTF-8! What do I have to do to really prevent Unicode from showing up in my variables? Hopefully, I don't have to wrap every string in my app with str()... [1] http://pylonshq.com/docs/en/0.9.7/tutorials/understanding_unicode/ -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Mako template examples
Hi everyone, I inherited a horrible mess of Myghty templates, most of which are a cut-and-paste disaster. I've decided to undertake refactoring them and converting to Mako. The Mako docs are great and explain all kinds of wonderful things I could do. But never having had a maintainable template system for an app that displays lots of tabular data, I don't really know where I want to go. I downloaded the pydotorg examples from the Mako site, but their system is wy more complicated than I need or want [1]. Anyone know of a free software app that uses Mako, in a pretty direct fashion, and has a nice template structure I could pick apart to learn from? Thanks, Ross [1] Though the approach of using RFC-822 headers in text files that get translated into HTML is probably the most brilliant idea I've ever seen in HTML construction. If that were refactored into a standalone library, I'd use it. It's beautiful, though complicated. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: config['pylons.request_options']['charset'] doesn't work at Pylons-0.9.7rc6?
On Thu, Feb 19, 2009 at 04:10:43AM -0800, Loucash wrote: I have to receive a POST data in iso-8859-2 and encode it to utf-8 and store in db. I'm using config['pylons.request_options']['charset'] = None to turn off default decoding, but with no success. Unicode is broken, and it is the same as without changing request_options. Any suggest? I ran into the same problem with an app that passes string-pickled objects over HTTP. I changed by pickle.loads(data) calls to pickle.loads(str(data)) - only happens in a few places in my code, and that was easier than figuring out the actual problem :) Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Sudden setuptools conflicts
Hey everyone, Recently, I've been working on an app that has branches using Pylons 0.9.6 and 0.9.7. Previously, to switch between them, I would do python setup.py develop and the requirements for my current version would be activated, overwriting the choices of the previous installation. Sometime in the recent past, setuptools stopped doing this. Now, when there's a conflicting version it bails out and warns me. I have to resolve the situation manually. This is really annoying - can I get the old behavior back? -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Beaker bug
On Feb 12, 3:11 pm, andres and...@octopart.com wrote: def end_session(self): session.delete() return 'session deleted' When you access start_session and test_session everything works as expected, but end_session does not remove the session from the server and it also doesn't expire the cookie. I just hit this issue today - imagine my surprise when I logged out my admin user and logged in a non-admin user and found myself with all of my admin settings :) This modified action does work though: def end_session(self): session.save() session.delete() return 'session deleted' Thanks for the workaround - this fixes my problem. Am I not understanding something about the way sessions work? Why you have to save() before calling delete()? Is this a bug? I recall reading that there were some changes to session handling in Pylons 0.9.7, but I seem to recall that they were related to automatically saving sessions, not removing them. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Sudden setuptools conflicts
On Fri, Feb 13, 2009 at 11:55:47AM -0800, Mike Orr wrote: On Fri, Feb 13, 2009 at 8:01 AM, Ross Vandegrift r...@kallisti.us wrote: Sometime in the recent past, setuptools stopped doing this. Now, when there's a conflicting version it bails out and warns me. I have to resolve the situation manually. This is really annoying - can I get the old behavior back? I have been getting version conflicts on something, but I can't remember what. Maybe WebOb, WebError, or simplejson. My solution was to upgrade the package individually and then install again. With so many packages having dependencies, it can be hard to keep them all in sync, or to tell what's a general problem vs something peculiar to your system. I get a lot on WebHelpers, switching between 0.6 and 0.3. But today I also had to uninstall Paste, PasteDeploy, and Routes, which kind of made me wonder what was going on. Hopefully I'll be fully cutover to 0.9.7 soon and won't have to deal with it anymore until the next version :). -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Beginners tutorial broken
On Fri, Feb 06, 2009 at 07:57:24PM -0800, Mike Orr wrote: By the way, what's the status of the QuickWiki tutorial? The website still has the 0.9.6 version. Last I heard two people were working on updates, which had to be merged. I went through the other night with a fresh 0.9.7rc4 installation, and with a newbie's eye, tried to follow every step. Course I kinda know what to fix when it breaks! To get things working, I had to make a number of changes, which I noted in a comment on the page. The majority of the problems come from things that used to be required for SA integration that are now made unnecessary by paster. The tutorial could stand some overall editorial control as well, but most of what is there is understandable. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: moving logic from controller to model
On Wed, Jan 28, 2009 at 02:04:38PM -0800, John Brennan wrote: Unfor. due to the nature of the project I cannot simply upgrade SA and Pylons (as much as I'd like to). I've upgraded a project through SQLObject - SA 0.3 - 0.4 - 0.5. The upgrade from 0.3 to 0.4 took me a non-trivial amount of time. Upgrading to 0.5 from 0.4 took me less than 10 minutes. The only change I had to make: - c.logs = query[first:last].all() + c.logs = query[first:last] which I had around in a few places. Upgrading to Pylons 0.9.7 has been more of a chore that I've put off a bit... This required a SIG amount of time because I had to add ...filter_by(purge_fl==True)... to every location where I'm doing a meta.Session.query(Book).filter... let's just say it was pretty painful!! [snip] Anyone else have ideas? SA's mappers can map to any Selectable. So if you can build a select that excludes things with purge_fl=True, you're done. http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-arbitrary-selects -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: moving logic from controller to model
On Tue, Jan 27, 2009 at 05:42:48PM -0800, John Brennan wrote: I'm trying encapulate all data stuff in the model. For example, I have a Book object so it would have methods like get, get_all, recent, etc. Those all work fine, but the problem occurs when trying to create a new Book object. /models/book.py: class Book(object): def get_all(self): query = meta.Session.query(Book).filter_by(user_id=1) return query.all() def save(self): meta.Session.save_or_update(self) meta.Session.commit() [snip] I can see that maybe the model can't save itself and instead the session should be saving it. But how do I go about doing that using this modular structure? SA treats your model object (ie, the class that encapsulates the logic of your application) separately from the Session (ie, the class that encapsulates information on how to save and restore persistent data for object instances). I think of it like this: a Book object should keep properties about itself - the title, author, publication data, editon, etc. But a Book is not the kind of object that saves and loads things to a database. [1] The SA Session is the kind of object that saves and loads things from a database. You setup mappers so that SA knows what to save. I would implement your object like this: class Book(object): def __init__(self, title, author): self.title = title self.author = author self.bookmark = None def bookmark(self, pageno): self.bookmark = pageno There's no database code in there, just Book code. Here's the database table information: import sqlalchemy as sa book_table = sa.Table(Column('id', sa.Integer, primary_key=True), Column('title', sa.Unicode()), Column('author', sa.Unicode())) Finally, you need an ORM mapper to link the two up: import sqlalchemy.orm as orm book_mapper = orm.mapper(Book, book_table) Then, in the pylons controller actions, I would do things like this: class SomeController(BaseController): def action(self): q = meta.Session.query(model.Book) c.paine = q.filter_by(author=Thomas Paine) c.jefferson = q.filter_by(author=Thomas Jefferson) return render(/showbooks.mako) (where showbook.mako iterates over those books and displays some interesting information about what's in the database). [1] At least, I have never seen such a book :) -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: SQLAlchemy models isn't abstract layer / data model
On Wed, Jan 21, 2009 at 08:33:03AM -0800, Jan Koprowski wrote: IMHO this could be standard for all classes (why not). I understood this SQLAlchemy forces you to write your own class methods wrap meta.Session - but this isn't cool :P because i waste my time :P Don't wrap meta.Session. That's a silly thing to do. The semantics of the session and the sematics of your object are *completely* seperate things. In SQLAlchemy, your model objects don't save themselves - the session commits their data. It seems like you're putting a square peg in a round hole. -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
On disk data files
Hey everyone, Is there a good place in a pylons project to put data files that need to be used by the app at various places? They don't need to be web accessible - strictly internal stuff. In this case I have some XSLT sheets that I need to load on demand. Easy enough to add one if I need to, just don't know if I need to. Thanks, Ross -- Ross Vandegrift r...@kallisti.us If the fight gets hot, the songs get hotter. If the going gets tough, the songs get tougher. --Woody Guthrie --~--~-~--~~~---~--~~ 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 For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Where should I put code shared by multiple controllers?
On Wed, Jul 02, 2008 at 09:45:58PM -0700, Mike Orr wrote: So when I needed a a semi-generic auth library that uses three tables, I put the integrity-checking function in the model because it depends on several custom queries. But the main auth code, which checks the password and instantiates the User object containing the permissions, is in a lib module. Just for an alternate perspective... I've taken a rich-model approach. Since the model defines the objects that the application uses, it's very natural to make the objects rich by extending their business-logic functionality in the model. In my version of the above, I'd have a User object that was capable of doing something like: try: u = model.User(username, password) except AuthFailure: ... Higher-level business logic that combines many different pieces of functionality from different model objects goes into the lib. I've found one downside to putting more functionality inside the model code. Suppose there are two classes, model.A and model.B. If A refers to some piece of B, it's very easy to run into circular import statements. Fixing that is a bit of a headache, but I've gotten better at not doing that :) -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Wed, May 21, 2008 at 12:20:18PM -0700, Cliff Wells wrote: On Wed, 2008-05-21 at 11:55 -0400, Ross Vandegrift wrote: 1) Users of other HTTP servers are always fiddling with them, restarting after crashes. This may be due to misuse, non-optimal config - I'm not sure. But I've never had stability issues like this with Apache. I had many issues with Lighttpd, but I've had none with Nginx. I'd also have to question your use of always in the above sentence. I strongly suspect aren't speaking from experience here, rather just hearsay. Hmmm, now that you mention it, I think all of those deployments may have been lighttpd. I had to hear a lot of the fallout - lighttpd was being used to generate tokens on servers that would be used for instantiating authentication credentials in a single sign-on server for admins. So there was much gnashing of teeth whenever this would crap out. I was fortunate enough to not have this be my baby, and mostly didn't have to deal with it. But I probably shouldn't continue to take that experience as indicitive of everything that's not Apache. And it's poorly understood by just as many, if not more. I first switched from Apache not due to scalability concerns (like you, I've not encountered them), but because I find Apache's configuration to be overwhelming and convoluted. Really? I can see it being overwhelming, but it seems very understandable to me. Paired with their documentation, I don't think I've ever had a real problem getting Apache to do something I knew it could. Well, unless you count kinda crazy, obscure mod_rewrite stuff - but of course that's a black art just because the rabbit hole goes as deep as you care to follow :). The fact that you need an army of support reps isn't really advancing your argument ;-) Heh, well, for every change needed to Apache, there's 1000 people that need help configuring their POP3 client. Apache is hardly the reason the reason there's an army :). This makes Apache best for... medium-sized sites that don't care about resource utilization? This is a ridiculous claim, so I'll assert instead that Apache is best if you need a *specialized* service, such as mod_svn or mod_jakarta. I don't think that's such a ridiciulous claim! Consider the application server that hosts the apps that I write for my company's internal use. It hosts four or six Pylons applications and one Rails app. One of these apps handles around 1000 uses a day, one around 100, one around 10. The Rails app is an AJAX form that just pushes collected data to the browser, so is usually busy despite only having an average of 1 user a day. The server these apps are housed on is gratuitously overpowered. Apache's flexability makes this use-case trivial. Maybe this deployment pattern is uncommon? Apache proponents will point out the wealth of modules as evidence that Apache is the best for general purpose web serving. But being best at fronting *particular* applications doesn't make it best *in general*. So it's not Nginx that's specialized for a particular workload, it's Apache that's specialized. Eh, I wouldn't make that claim about Apache modules. Many of them are irrelevant to me, some seem downright pointless. Nginx is like a finely-balanced chef's knife: suitable for a variety of tasks, large and small, as long as they all involve slicing. Apache, on the other hand, is the swiss-army knife of webservers: bulky, full of odd specialty tools, and on occasion, marginally useful as a knife. In either case, apparently they both make for a funny lump in some people's pockets ;-) I wouldn't want the lump of a chef's knife anywhere near my pocket, lest I be bleeding out all over the floor! Anyway, I think we've gone way OT for long enough. We can continue offlist if you like. I'm more or less done - I think you've convinced me that Nginx is probably worth another look at some point. After all, there's nothing wrong with having another tool around to solve some problem, even if Apache is where I'd go first. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: How did you begin your fun with Pylons?
On Fri, May 23, 2008 at 08:46:39AM +0200, Raoul Snyman wrote: I will have to agree with the sentiments already voiced here. The documentation is very sparse, and it relies on the user having a good understanding of MVC frameworks (like RoR and CakePHP). Actually, I've found that it's a case of looking more complicated than it really is. Nine times out of ten, when I am frustrated and can't solve something, I start reading documentation and code. And it goes nowhere. But then I come back to reading that same code after stepping away for a while, and I'm surprised at how simple everything is. As far as my heartwarming Pylons story - I inherited a Pylons app written by someone else. The original developer liked Python, and for whatever reason, chose Pylons as the framework of choice. I took over work on that app, and for a long time, I didn't even need to know much about Pylons to add features. The fact that I could do this as a part of my first exposure to real web programming (I'm a C guy, by history...) was remarkable, so I stuck with it. Now I feel like I have a half-decent grasp on it without it being too painful - how many times has someone said that about an app that they unfortunately inherited? :) -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Tue, May 20, 2008 at 02:01:26PM -0700, Cliff Wells wrote: According to Netcraft, Nginx is now deployed in front of over 1 million domains. Not nearly as much as Apache, but clearly not all of those are highly isolated environments. In fact, many sites with heavy traffic are moving to Nginx due to it's vastly superior scalability. Some notables that use Nginx: wordpress.com youtube.com hulu.com rambler.ru torrentreactor.net kongregate.com Where did you get your research from? (Actually, don't answer that, I can guess). Sites that are amongst the largest on the internet fall into a corner case in my mind. As Mike pointed out, sites have an unrealistic expectation of traffic. I've been involved in the average cases. My claims come from years in the service provider industry, watching various deployments. I've been an Apache fan for a long time, and have seen and deployed hundreds of servers, serving thousands of sites on Apache. None are youtube.com - and I agree that this is an important point. Comparing my Apache deployments with deployments of other servers, year after year, Apache won hands down: 1) Users of other HTTP servers are always fiddling with them, restarting after crashes. This may be due to misuse, non-optimal config - I'm not sure. But I've never had stability issues like this with Apache. 2) Apache is well-understood by many more folks. There's an army of support reps downstairs that are compentent, if not experts, at maintaining and troubleshooting it. The other servers come across as mysteries (despite often being highly trivial), and end up escalated instead of fixed. 3) Documentation for Apache is through, searchable, and understandable. It's full of examples, is available for multiple versions of httpd. I have seen the Apache documentation turn motivated people from competent levels to expert just by googling for it. I'm not saying that other servers don't have decent docs - but Apache's are amongst the best docs for any software I have ever read, and I have seen them function in production for years. I'd qualify this paragraph as some of Apache's strengths are, rather than a blanket it's better. For some people, in some settings, it is better. For others it isn't. If you need high scalability, it isn't the best. If you need a small memory footprint it's not the best. If you prefer a sane configuration syntax it isn't the best. If you need all three then it's arguably amongst the worst. Yea, you're right - I'm tacitly assuming that we're talking about the average cases. Other http servers definitely excel at things, especially for workloads they have been specially designed. But for every youtube there's tens of thousands of websites with more average traffic and control needs. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Wed, May 21, 2008 at 09:49:32AM -0700, Mike Orr wrote: So how do you handle writes? You direct them all to one master server and let it propagate the changes to the slaves? Have you found a good replicable database among the free ones that work with SQLAlchemy? Postgres was mentioned; I'll add that MySQL's replication is also quite good for splitting out reads against replicas if your application isn't write bound. MySQL Cluster is now GA, with provides for HA db servers and performance scalability without splitting reads and writes between different servers. Downside is that you need at least four servers -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Mon, May 19, 2008 at 12:36:11PM -0700, Mike Orr wrote: On Sun, May 18, 2008 at 12:44 PM, Ross Vandegrift [EMAIL PROTECTED] wrote: I have considered converting our deployments to mod_python, but only recently acquired a practical staging environment to test things like that. There was a point in using mod_python before mod_wsgi existed. Now that mod_wsgi exists, is more directly related to the task, and has a better history of being reliable, why not use it? Good question. I have done some rudimentary testing on mod_python, but not with mod_wsgi. It does make a lot of sense to me - I should definitely test that out before I make any decisions on production deployment changes. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Mon, May 19, 2008 at 09:10:27PM -0700, Jonathan Vanasco wrote: so is Apache considered to be a good thing (through mod_wsgi , mod_python , or other ?) i've been doing mod_perl dev for years, and have had some experience with mod_python -- generally speaking, my experience is that if you can avoid apache you're better off. i guess that's what is throwing me off. i equate apache with isn't there a better way now? I don't mean to come off as sounding curt, but I've often heard that from people who haven't really maintained the alternatives. Or that have an application that gets deployed in a highly isolated environment, where interoperability means nothing. Frankly, the flexability of Apache is what makes it so much better than the alternatives. It has solid support for just about anything related to the web. It has excellent, complete documentation surrounded by a large, knowledgeable user community. I equate Apache with There is no better general solution, even though various half-assed alternatives have been cooked up. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Mon, May 19, 2008 at 10:43:06AM -0700, [EMAIL PROTECTED] wrote: what is your platform? i just tried fcgid on centos 5.1 not long ago, with mod_fcgid-2.1-3.el5 from epel.repo + apache (version come with centos2.5) + python 2.4, following this wiki http://wiki.pylonshq.com/display/pylonscookbook/Production+Deployment+Using+Apache%2C+FastCGI+and+mod_rewrite%2C+alternate+version Apache 2.0.52 from RHEL4, Python 2.4, Flup 0.5, some version of fcgi that appears to have been custom installed and I cannot figure out the version for the life of me Ross there seems to be a bug and i can reproduce it easy. a fresh project create by paster create -t pylons project will run no problem. any other project with sql access will just crash. i've try the quickwiki demo and it won't work too. i've also try mod_wsgi from epel.repo but the same occur. i am too lazy to try and recompile everything so i end up running it behind proxy rgds, Vincent On May 19, 3:44 am, Ross Vandegrift [EMAIL PROTECTED] wrote: On Fri, May 16, 2008 at 01:38:24PM -0700, Jonathan Vanasco wrote: I'm a little unclear on the better ways to deploy a Pylons app. My production servers run nginx -- is it better to use some fastcgi support (if so, how?) or just do a paster serve and proxy to that port? I've read a handful of ways on how-to-deploy apps, and all seem different. I've yet to see a comparison or this is THE way to do it document. All of my apps are deployed in a FastCGI environment with Apache. Our live application server has a custom install of python2.4 with appropriate module versions that we can care for beside the ones that RedHat wants. This works really well. It seems a lot of people hate FCGI for different reasons, but I have found it to be pretty awesome. Apps are very stable, no complicated proxying, and it's almost as performant as mod_python. I have considered converting our deployments to mod_python, but only recently acquired a practical staging environment to test things like that. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Deployment Question
On Fri, May 16, 2008 at 01:38:24PM -0700, Jonathan Vanasco wrote: I'm a little unclear on the better ways to deploy a Pylons app. My production servers run nginx -- is it better to use some fastcgi support (if so, how?) or just do a paster serve and proxy to that port? I've read a handful of ways on how-to-deploy apps, and all seem different. I've yet to see a comparison or this is THE way to do it document. All of my apps are deployed in a FastCGI environment with Apache. Our live application server has a custom install of python2.4 with appropriate module versions that we can care for beside the ones that RedHat wants. This works really well. It seems a lot of people hate FCGI for different reasons, but I have found it to be pretty awesome. Apps are very stable, no complicated proxying, and it's almost as performant as mod_python. I have considered converting our deployments to mod_python, but only recently acquired a practical staging environment to test things like that. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: Auth and Auth
On Fri, Mar 28, 2008 at 10:19:35PM -0700, Mike Orr wrote: Their argument seems to be not that it doesn't work (the previous bugs have been fixed), but that you can write your own authentication in the time it takes to learn it. I haven't used AuthKit in a program so I can't say definitively one way or the other. As for the number of AuthKit discontents, it's impossible to say whether they're a substantial percentage of the Pylons userbase or a small number of loud activists. I recently attempted to upgrade an existing application from an ad-hoc authentication and authorization framework to AuthKit. In the end, I decided my ad-hoc method was better. I'm not an AuthKit expert, though I did give it a good try. Here were my reasons: 1) Bad documentation is worse than no documentation. Much of the AuthKit documentation is out of date enough that it leads you down the wrong path. The API reference are more useful than the examples, but they are very difficult to follow, without being familiar with the guts of AuthKit. 2) The only way I could determine to get style control over the login screen (the forward method), was very complicated to implement. As Mike said, complicated enough that I could write my own middleware to do it in a similar amount of time. 3) What's worse is that I could never get forward authentication working. The nice decorator syntax and uniform authorization API was what I wanted, but I couldn't get to that point. AuthKit is probably most helpful if you have a complex permissions scheme and use the built-in plugins. It's less helpful if you use the forward feature to call back into the application for the login form. In that case you're doing most of the work yourself anyway and merely shoehorning it into AuthKit's API. I agree with you 100% here, but I'll take it a step further. Authkit's API is what's great about it. But who wants to choose the barebones login screen it provides or an HTTP authentication window? Is that really a common use case? AuthKit's ability to express complex permissions for authorization is really awesome, and it's where I see a lot of the value - the API is very well considered. But getting an app with a custom login screen converted over to it was enormously difficult. In that case you have to ask whether five lines of AuthKit API calls is really better than five lines of homegrown code. Probably not, and I think Gardner would agree here. For complex permissions, this is a gross underestimate. My app (though it could use some refactoring at this point) has hundreds of lines for permissions between different roles and groups of users. It includes LDAP interaction to get that data. It also has really ugly hooks into the controllers to verify a user. The object model of roles in AuthKit is the value - it's a lot like RADIUS/TACACS+ if you're familiar with the router kind of AAA model. I found that it wasn't trivially easy to reproduce that. I see that AuthKit does both, but I'm not sure how well it cascades from one to the other, or whether it will accept my existing Users table. It does? I couldn't find any information on linking AuthKit with LDAP (without writing my own objects to do it). And most of the information I could find on using a database table seemed to be about people unable to get it working. I had good luck with statically configured users, but this doesn't scale. In summary - it might just be a documentation issue. I really like AuthKit's ideas. They seem very correct to me. It's just too difficult to integrate into an app. -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
paginate with SQLAlchemy Query
Hi Everyone, I was trying to movbe some custom pagination code over to the paginate module and ran into a problem. My code look like this: v = model.sac.query(model.Vlan) ... v = v.filter_by(...) c.page = paginate.Page(v, current_page=page_nr) Paginate bounces me the error: exceptions.TypeError: Sorry, your collection type is not supported by the paginate module. You can either provide a list, a tuple, an SQLAlchemy table or an SQLAlchemy query object. Pylons error handling middleware confirms that v is a SQLAlchemy query object: v sqlalchemy.orm.query.Query object at 0xb0d6a80c What's up with that? -- Ross Vandegrift [EMAIL PROTECTED] The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell. --St. Augustine, De Genesi ad Litteram, Book II, xviii, 37 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---