Re: problem with TypeError when raising exception by AuthKit
I found solution. As I suspected, the problem was with Python version. AuthKit egg is available only for Python 2.5 and I used 2.4. So just upgrade to Plone 2.5 and it works as expected On 11 Lis, 10:09, Maciek [EMAIL PROTECTED] wrote: Hi, I am trying to use AuthKit in Pylons (0.9.7) but I get TypeError when using @authorize(RemoteUser()): File /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/authorize/ wsgi_adaptors.py, line 102, in __call__ return self.permission.check(self.app, environ, start_response) File /Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/ permissions.py, line 174, in check raise NotAuthenticatedError('Not Authenticated') TypeError: exceptions must be classes, instances, or strings (deprecated), not NotAuthenticatedError I couldnt find any info about it in google. Can you maybe have any idea what can be wrong? Maybe Python version should be higher? Greetings, Maciek --~--~-~--~~~---~--~~ 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: Pylons 0.9.7, AuthKit 0.4.2 - TypeError exceptions must be classes....
I had the same problem, you can check http://groups.google.pl/group/pylons-discuss/browse_thread/thread/2cc8f8a07721269b The solution is to use Python 2.5 at least. AuthKit egg is aviable only for Python 2.5 Maciek On 12 Lis, 15:56, Thomas Johnson [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I am a new pylons user and am having a few issues with AuthKit. I attempted to follow a few tutorials that covered the setup of AuthKit but they seemed pretty dated. I ended up using epydoc to generate the documentation for pylons and authkit. I have managed to get a basic setup of AuthKit working but now I am trying to get UsersFromDatabase authentication working. The tutorials that I have read so far are: http://pylonsbook.com/alpha1/authentication_and_authorizationhttp://wiki.pylonshq.com/display/pylonscookbook/AuthKit+0.4+UsersFrom... My controller is: import logging import datetime from myapp.lib.base import * from pylons import tmpl_context as c from pylons.templating import render_mako as render log = logging.getLogger(__name__) from authkit.authorize.pylons_adaptors import authorize, authorized from authkit.permissions import RemoteUser, ValidAuthKitUser class FooController(BaseController): @authorize(ValidAuthKitUser()) def private(self): response.status = 401 Not authenticated return You are not authenticated I see the following error when I attempt to view /foo/private(when not logged in): File 'string', line 1 in lambda File '/usr/lib/python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/authorize /pylons_adaptors.py', line 36 in validate return permission.check(app, request.environ, self.start_response) File '/usr/lib/python2.4/site-packages/AuthKit-0.4.2-py2.4.egg/authkit/permissio ns.py', line 300 in check raise NotAuthenticatedError('Not Authenticated') TypeError: exceptions must be classes, instances, or strings (deprecated), not NotAuthenticatedError I can't help but feel like I am missing extremely simple somewhere. Any suggestions would be great. cheers, Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org iD8DBQFJGu6Up0KneERU9LsRAvo4AJwLJsED3fC1ZT8DH5r4UefKAX1yFQCfXL/i bk1O6XCMSs1FdS4TF5ACnBg= =zs9P -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-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 -~--~~~~--~~--~--~---
Why does a route with unmatched conditions give 500 and not 404?
I would like to support specific http verbs on a given URI. For example, to support GET and PUT for the URI /controller/action/id I have defined these 2 dedicated routes: map.connect('/controller/action/:id', controller='controller', action='GET_action', conditions=dict(method=['GET'])) map.connect('/controller/action/:id', controller='controller', action='PUT_action', conditions=dict(method=['PUT'])) Issuing a GET or PUT for this (same) URI will cause the correct action to be executed... however, if I issue a request with a different method, such as a POST, the response is a 500 Internal Server Error. I would have expected a 404 Not Found, as is normally returned for no matching route. A simple workaround (amongst other more elaborate -- and imho more convoluted -- local dispatching mechanisms) is to follow up the above routes with a catchall for the any other verbs: map.connect('/controller/action/:id', controller='controller', action='OTHER_action') that would then be supplied as a method on controller simply to return 404: def OTHER_action(self, id): abort(404) So, why the 500 and not the 404 in the first place? Any other suggestions of how best to handle such situations? mario --~--~-~--~~~---~--~~ 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: 'c' variable between redirects
Just a quick summary of what I found to be useful (though I don't yet use new Pylons) Flash Messages. It solves issues of 'c' being too transient, and session scope being too wide. T. -- _i__'simplicity_is_the_key'__tomasz_nazar _ii'i_am_concern_oriented'JKM-UPR _iii__'patsystem.sf.net'___linux_user _'aspectized.com'___prevayler --~--~-~--~~~---~--~~ 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: Pylons and Python 2.6 (Was: Re: go-pylons.py broken on Python 2.6 in Windows?)
On Wed, Nov 12, 2008 at 1:48 AM, Alex Marandon [EMAIL PROTECTED] wrote: By the way is the production version of Pylons also know to be compatible? How about the libraries often used with Pylons (Routes, Mako, SQLAlchemy, Elixir, etc.)? Has anyone here started to migrate their production Pylons apps to Python 2.6? I'm using Python 2.5 for three apps including one which will launch next month. If I weren't so busy and if the Python 3 switch weren't coming up in a few months, I might be more inclined to upgrade quicker. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pylons and Python 2.6 (Was: Re: go-pylons.py broken on Python 2.6 in Windows?)
2008/11/11 Ben Bangert [EMAIL PROTECTED]: On Nov 11, 2008, at 7:38 AM, Alex Marandon wrote: As far as I know, Pylons doesn't support Python 2.6, no matter what operating system you're on. At least that's how it was last time I checked. Pylons does run on Python 2.6, and we have buildbots that run to ensure the tests all pass on Python 2.6. RC3 is the first release to use all the new builds for it, though a few bugs crept in so RC4 will be out shortly. Oh that is good news! I apologize for spreading erroneous information. I can see that the problem which was preventing nose to run on Python 2.6 has now been fixed. I should have checked before posting. By the way is the production version of Pylons also know to be compatible? How about the libraries often used with Pylons (Routes, Mako, SQLAlchemy, Elixir, etc.)? Has anyone here started to migrate their production Pylons apps to Python 2.6? --~--~-~--~~~---~--~~ 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: Why does a route with unmatched conditions give 500 and not 404?
On Wed, Nov 12, 2008 at 2:00 AM, mario ruggier [EMAIL PROTECTED] wrote: I would like to support specific http verbs on a given URI. For example, to support GET and PUT for the URI /controller/action/id I have defined these 2 dedicated routes: map.connect('/controller/action/:id', controller='controller', action='GET_action', conditions=dict(method=['GET'])) map.connect('/controller/action/:id', controller='controller', action='PUT_action', conditions=dict(method=['PUT'])) Issuing a GET or PUT for this (same) URI will cause the correct action to be executed... however, if I issue a request with a different method, such as a POST, the response is a 500 Internal Server Error. I would have expected a 404 Not Found, as is normally returned for no matching route. A simple workaround (amongst other more elaborate -- and imho more convoluted -- local dispatching mechanisms) is to follow up the above routes with a catchall for the any other verbs: map.connect('/controller/action/:id', controller='controller', action='OTHER_action') that would then be supplied as a method on controller simply to return 404: def OTHER_action(self, id): abort(404) So, why the 500 and not the 404 in the first place? Any other suggestions of how best to handle such situations? It should be 404 and it usually is. There must be a bug in how it processes the particular argument combination. What happens if you comment out the second route and remove the condition in the first? -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pylons/ Tesla bind problem
Hi everyone! I'm diving into Pylons and Tesla for the first time and I'm running into an issue while querying on any table. Example: code % paster shell model.Location.query.all() UnboundExecutionError: Could not locate a bind configured on mapper Mapper|Location|Location, SQL expression or this Session /code I can use this Elixir model just fine outside of Pylons/ Tesla. I'm guessing I'm not wiring something correctly. Any help would be _greatly_ appreciated. Details: Mac OS 10.5 Python 2.5 Pylons-0.9.7rc3 Tesla-0.2.7 Elixir-0.6.1 Thanks! -A --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Pylons powered - New site
Hello all, I'm very proud to announce a new pylons powered site for public usage: http://www.qubesport.net/ We (p-square) implemented it by request of a customer, and have developed on it since the beginning of August. We have a strong background in Python programming (using it on production stuff for a couple of years now), but it was the first pylons project we made. Qubeport is implemented on top of Pylon 0.9.6, using SQLAlchemy and Mako as standard components, as well as ToscaWidgets and tw.forms for form display. We have developed a couple of custom widgets for tw, and I'm in the process of making those ready for release. The deployment on the production site is done using mod_wsgi on a threaded apache, using a postgreSQL database for datastorage, and a solr (http://solr.apache.org) instance in a tomcat for all searching against the data. For that we have developed a custom interface and controller base, to make developing search form easy and painless. It has been a great experience developing in Pylons, and we are already planning 3 or 4 further projects in Pylons, so this probably won't be the last you hear from us. Thanks especially to Alberto, who has been very patient in answering all my questions regarding ToscaWidgets (and even enduring my occassional rant about less than optimal documentation ;) ), Michael Bayer who directed me to Pylons through Myghty (which we have used for a former project), and all the other people here on the mailing list who have been helpful and discussed with me a lot during the whole time doing the implementation. Regards, Jens Hoffrichter Manager Engineering Development -- p-square oHG - smart programming for smart people Schultesche Heide 23 - D-44807 Bochum phone +49 (0)234 5164848 - fax +49 (0)234 5164849 www.p-square.de - [EMAIL PROTECTED] Geschäftsführer: Marcel Abts, Jens Hoffrichter Handelsregister: Bochum, HRA 5062 Umsatzsteuer-ID: DE237757109 --~--~-~--~~~---~--~~ 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: Pylons/ Tesla bind problem
On Wed, Nov 12, 2008 at 2:41 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone! I'm diving into Pylons and Tesla for the first time and I'm running into an issue while querying on any table. Example: code % paster shell model.Location.query.all() UnboundExecutionError: Could not locate a bind configured on mapper Mapper|Location|Location, SQL expression or this Session /code I can use this Elixir model just fine outside of Pylons/ Tesla. I'm guessing I'm not wiring something correctly. Any help would be _greatly_ appreciated. I can tell you what's happening in general, but not specifically what's wrong in the Tesla configuration. Whatever is performing the SQL operation is not providing an Engine or Connection to execute it with, so these two parts of the application are not communicating properly. At the simplest level, you execute statements via 'engine.execute(sql)'. But if you tell a SQL statement or ORM object to execute itself, it looks for an engine/connection in the following order: - 'bind' argument to the method - engine bound to the session (set via sessionmaker options), *if* the operation was invoked from a session object - engine bound to the metadata (set via 'metadata.bind = engine' or 'MetaData(engine)' If it can't find an engine in any of these, it'll fail with this error. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: Pylons/ Tesla bind problem
Thanks for the response! I'll root around and if I find the culprit, I'll post my findings back here. On Nov 12, 5:00 pm, Mike Orr [EMAIL PROTECTED] wrote: On Wed, Nov 12, 2008 at 2:41 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone! I'm diving into Pylons and Tesla for the first time and I'm running into an issue while querying on any table. Example: code % paster shell model.Location.query.all() UnboundExecutionError: Could not locate a bind configured on mapper Mapper|Location|Location, SQL expression or this Session /code I can use this Elixir model just fine outside of Pylons/ Tesla. I'm guessing I'm not wiring something correctly. Any help would be _greatly_ appreciated. I can tell you what's happening in general, but not specifically what's wrong in the Tesla configuration. Whatever is performing the SQL operation is not providing an Engine or Connection to execute it with, so these two parts of the application are not communicating properly. At the simplest level, you execute statements via 'engine.execute(sql)'. But if you tell a SQL statement or ORM object to execute itself, it looks for an engine/connection in the following order: - 'bind' argument to the method - engine bound to the session (set via sessionmaker options), *if* the operation was invoked from a session object - engine bound to the metadata (set via 'metadata.bind = engine' or 'MetaData(engine)' If it can't find an engine in any of these, it'll fail with this error. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---