pyramid_ldap authentication ldap.SCOPE_SUBTREE

2012-08-22 Thread Eric Lemoine
Hello

I'm trying to use pyramid_ldap with the ldap.SCOPE_SUBTREE scope in
config.ldap_set_login_query. This is because the main directory is
composed of multiple sub-directories (I'm not an LDAP expert, so I'm
not what I'm saying makes sense, sorry). The problem is that the
authenticate function always returns None in that case, because the
number of results returned by the search call is greater than 1
(search response provided below). See
https://github.com/Pylons/pyramid_ldap/blob/master/pyramid_ldap/__init__.py#L118.
Does what I'm doing actually make sense at all? Does pyramid_ldap
support SCOPE_SUBTREE for login/authentication?

Here is the response I get from the LDAP search call:

 [
('CN=Kalbermatten
Micha\xc3\xabl,OU=NoRoamingProfiles,OU=SGRF,OU=SGRF,OU=DGT,OU=Utilisate
urs,OU=ACN,DC=ne,DC=ch', {'accountExpires': ['0'], ...}),
(None, ['ldap://vdn.ne.ch/DC=vdn,DC=ne,DC=ch']),
(None, ['ldap://vch.ne.ch/DC=vch,DC=ne,DC=ch']),
(None, ['ldap://sne.ne.ch/DC=sne,DC=ne,DC=ch']),
(None, ['ldap://DomainDnsZones.ne.ch/DC=DomainDnsZones,DC=ne,DC=ch']),
(None, ['ldap://ForestDnsZones.ne.ch/DC=ForestDnsZones,DC=ne,DC=ch']),
(None, ['ldap://ne.ch/CN=Configuration,DC=ne,DC=ch'])
]

Thanks for any insight.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: pyramide 1.3 starter problem

2012-05-31 Thread Eric Lemoine
On Thu, May 31, 2012 at 4:57 PM, Bruno Binet bruno.bi...@camptocamp.com wrote:
 On 31 May 2012 14:25, Daniel Braniss da...@cs.huji.ac.il wrote:
 Hi,
 I'm trying out pyramid 1.3, and after running
        pcreate -s starter foo
 then
        python setup.py

 I think this should be:
          python setup.py develop

That's indeed what's documented:
http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/project.html#installing-your-newly-created-project-for-development.
This was different with Pyramid  1.3 and Paste.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



plugable authentication

2012-05-28 Thread Eric Lemoine
Hi

My Pyramid-based framework includes a “login” view that looks like this:

def login(request):
username = request.params.get('username')
password = request.params.get('password')
if username is None or password is None:
return HTTPBadRequest(...)
user = Session.query(User).filter_by(username=username).first()
user_is_valid = user and user.validate_password(password)
if user_is_valid:
headers = remember(request, username)
return HTTPFound(location=request.params.get('come_from'),
headers=headers)
return HTTPUnauthorized(...)

So this login action gets the user from a “user” database table, and
validates the password by calling “validate_password” on the “user”
(SQLAlchemy) object. The action also takes care of returning an appropriate
HTTP response, based on the received HTTP params and whether the user can
be authenticated or not.

I'd like the make the authentication/password validation process
configurable. Applications based on my framework should be able to register
their own authentication/password validation process. And I'd like to know
what's the best way to achieve that.

The application could overwrite the “login” view completely. But the
“login” view includes logic that I think should not be duplicated.

So I'd rather put the code

 user = Session.query(User).filter_by(username=username).first()
user_is_valid = user and user.validate_password(password)

in a “default” function, and make it possible for applications to overwrite
this function.

I've been thinking about adding a configurator directive (with
add_directive) for that, like “set_user_authenticator” or something. But
I'm wondering if this is an appropriate solution, or it there are more
Pyramid standard ways for that.

Any guidance welcome.

Thanks,


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Pyramid 1.3 DeprecationWarning

2012-05-21 Thread Eric Lemoine
On Sun, May 20, 2012 at 12:53 PM, Vlad K. v...@haronmedia.com wrote:


 Okay, this helped a lot. Installed Pyramid 1.3.2, upgraded zope.deprecation
 back to 4.0.0, zope.interface back to 4.0.0, had also to upgrade transaction
 to 1.3.0 (dep of zope.sqlalchemy, which I also upgraded to 0.7.1).

 The only DeprecationWarning left is from Chameleon 2.8.5.

I also see this DeprecationWarning. Am I correct to understand that
there's currently no way to get rid of it?

Thanks,


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: SQLAHelper status

2012-05-16 Thread Eric Lemoine
On Wed, May 16, 2012 at 9:59 PM, Mike Orr sluggos...@gmail.com wrote:
 On Tue, May 15, 2012 at 10:45 PM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:
 Did this patch make it into the “version 1” branch? If so would it make
 sense to make a bug fix release?

 There's only one branch, 'master'. Version 1 is the 'v1.0' tag. The
 next maintainer can make a version 1 branch from that if he wishes.

 FWIW, we still use SQLAHelper here, but I guess we could quite easily drop
 it. We still have like module interdependency issues but I guess this is bad
 design on our side.

 You could put the Session and Base in a 'meta' module that is not a
 parent of the other model modules and does not import them, as Pylons
 does.

 The Pyramid default just puts them in the top level in the model. This
 sometimes works and sometimes doesn't, depending on what other global
 code is in your modules and whether it's above or below the import
 statements.

 If you do stick with SQLAHelper I'd suggest using the version 2 API,
 which is more straightforward and has fewer getters/setters.

Thanks Mike.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: SQLAHelper status

2012-05-15 Thread Eric Lemoine
On Wednesday, May 16, 2012, Mike Orr wrote:

 I put a notice in the SQLAHelper README that it's under a maintenance
 freeze. I merged a patch by aodag



Did this patch make it into the “version 1” branch? If so would it make
sense to make a bug fix release?

FWIW, we still use SQLAHelper here, but I guess we could quite easily drop
it. We still have like module interdependency issues but I guess this is
bad design on our side.


Thanks for the notice.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



custom view params

2012-05-06 Thread Eric Lemoine
Hi

I'd like to be able to set custom config parameters in my views, and read
these parameters from request objects. Is this at all possible?

For example:

@view_config(route_name='a_route', renderer='a_renderer',
custom_param='some_value')
def v(request)
 return {}


Thanks.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Default renderer

2012-05-06 Thread Eric Lemoine
On Sunday, May 6, 2012, León Domingo wrote:

 Hi guys,

 Is there a way to define a default renderer so every template will be
 rendered using that particular language? I work with Jinja (the problem
 would be the same with another language) and the thing is that I use it to
 render to HTML (most of the time) but to JS too and even to XML sometimes.
 I don't want to have files whose extension is .jinja2 Which one is HTML and
 which one is JS?



Won't

config.add_renderer('.hml', ...)
config.add_renderer('.js', ...)
config.add_renderer('.xml', ...)

work for you?



-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: custom view params

2012-05-06 Thread Eric Lemoine
On Sun, May 6, 2012 at 6:50 PM, Michael Merickel mmeri...@gmail.com wrote:
 Do custom predicates solve your problem?

 def extra_params(*params):
    def _predicate(context, request):
        request.extra_params = params
        return True

 @view_config(route_name='a_route', renderer='a_renderer',
 custom_predicates=[extra_params('some_param')])
 def v(request)
    params = request.extra_params
    return {}

 If not, view_config also supports a few other constructs for wrapping
 views (such as decorator).

Thanks for the suggestions. I'll look into more detail.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Benchmark of paster

2011-06-16 Thread Eric Lemoine
On Thursday, June 16, 2011, Liju lij...@gmail.com wrote:
 Has someone done a benchmark for paster server ? As per the
 documentation to deploy pyramid using ngnix in the mix (for load
 balancing etc) paster is used. I have also seen in this and other
 forums that folks use this architecture in production. So it will be
 good to know how paster perform  how stable it is.


I have observed that Paste Server has a per-request overhead that is
significantly larger than Apache mod_wsgi.  Sorry I have no numbers to
back this.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: simple example using repoze.who for authorization in pylons-app

2011-05-04 Thread Eric Lemoine
On Thursday, May 5, 2011, cd34 mcd...@gmail.com wrote:
 On May 4, 12:18 pm, Rob Miller r...@kalistra.com wrote:
 On 05/04/2011 07:30 AM, cd34 wrote:

 http://cd34.com/blog/framework/repoze-whorepoze-what-with-pylons-step...

 Speaking of which, I gave you mad props for your various Pylons to Pyramid
 blog posts in the talk on migrating to Pyramid that I gave at the SF MiniCon
 last week.  Thanks for those!

 Thanks! always good to hear that it was useful to someone.

 Also, I've written up some thoughts on the MiniCon and posted my slides 
 athttp://blog.nonsequitarian.org/2011/pylons-project-mini-conference/for 
 anyone
 who's interested.

 Looks like quite a conference. I've followed quite a few of the other
 participants as they posted their slides. I'm on the wrong coast.  haha

Do not complain, others are on the wrong continent :-)

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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 1.0, Routes] I look for an url generator but in Javascript

2011-04-14 Thread Eric Lemoine
On Thursday, April 14, 2011, Stéphane Klein steph...@harobed.org wrote:
 Hi,

 context : Pylons 1 and Routes

 some time, I need to construct some links like h.url(route_name, 
 param1=foobar) but in Javascript.

 I would like a url contructor 
 (http://routes.groovie.org/modules/util.html#routes.util.url_for) in 
 javascript. Does someone have already create this tools ?

Hi Stéphane

We use Mako templates for that here. Like:

script
var url = ${url(controller=foo, action=bar)};
/script

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: add_route and view_attr

2011-04-11 Thread Eric Lemoine
On Thu, Apr 7, 2011 at 8:20 PM, Michael Merickel mich...@merickel.org wrote:
 To solve your problem you probably just need to remove the view_attr from
 add_route and call config.scan().
 The problem here is the ambiguity in add_route because it supports routes
 and the ability to add a single view. Rather add_view and view_config are
 identical except that view_config requires to you call config.scan() to
 place the decorator within your code, instead of within your config.

You're right. It makes sense. And it works! Thank you.



-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



add_route and view_attr

2011-04-07 Thread Eric Lemoine
Hi

I have view class defined as follows:

class Entry(object):
def __init__(self, request):
self.request = request
self.debug = debug in request.params
lang = request.params.get(lang,
request.registry.settings.get(default_locale_name))
self.lang = lang

@view_config(route_name='home', renderer='templates/index.html')
def home(self):
return {'lang': self.lang, 'debug': self.debug}


And a route to the home action defined with this:

config.add_route('home', '/', view_attr='home')


But Pyramid complains:

pyramid.exceptions.ConfigurationError: view_attr argument not
permitted without view argument


The thing is I'd like to specify the renderer through the view_config
decorator, so it is defined as close as possible to my home def. But
using add_route, and binding view_config and add_route together
through the route_name attribute, doesn't work either.

Is there a solution to this problem?

Thanks,


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: add_route and view_attr

2011-04-07 Thread Eric Lemoine
On Thursday, April 7, 2011, Gael Pasgrimaud g...@gawel.org wrote:
 Hi,

 On Thu, Apr 7, 2011 at 4:47 PM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:
 Hi

 I have view class defined as follows:

 class Entry(object):
    def __init__(self, request):
        self.request = request
        self.debug = debug in request.params
        lang = request.params.get(lang,
                    request.registry.settings.get(default_locale_name))
        self.lang = lang

    @view_config(route_name='home', renderer='templates/index.html')
    def home(self):
        return {'lang': self.lang, 'debug': self.debug}


 And a route to the home action defined with this:

 config.add_route('home', '/', view_attr='home')


 Don't know why you are using two different configuration. add_route
 and view_config do the same thing. Eg: add an entry to the registry.

 You just need to use add_route:

 config.add_route('home', '/', view_attr='home',
 view='yourmodule.Entry', renderer='...')

Hi Gael. I know this works, but I've been looking at separating
concerns, that is specifying route-related stuff with add_route, and
view-related stuff with view_config. As far as I know this can be
achieved using route_name to bind the route to the view_config at
config.scan time. But it doesn't work when specifying a view_attr in
add_route.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Pyramid for Pylons users guide

2011-01-15 Thread Eric Lemoine
On Sat, Jan 15, 2011 at 4:53 AM, Mike Orr sluggos...@gmail.com wrote:
 Hi all, I'm starting an article on Pyramid for Pylons 1 users,
 focusing on the differences between the frameworks and how to do
 familiar things in Pyramid. It'll also cover add-on stuff like forms
 and auth, or at least list the alternatives available.

 I'm wondering if there are any particular questions people would like
 included. If so, please email them to me.

Thanks a lot for that Mike.

I've been pluging in WSGI apps in Pylons controllers, as described
at 
http://pylonsbook.com/en/1.1/the-web-server-gateway-interface-wsgi.html#wsgi-in-pylons-controllers.
I'd be very interested to know if and how this can be done in a
Pyramid application.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Pyramid for Pylons users guide

2011-01-15 Thread Eric Lemoine
On Saturday, January 15, 2011, Gael Pasgrimaud g...@gawel.org wrote:
 On Sat, Jan 15, 2011 at 3:12 PM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:
 On Sat, Jan 15, 2011 at 4:53 AM, Mike Orr sluggos...@gmail.com wrote:
 Hi all, I'm starting an article on Pyramid for Pylons 1 users,
 focusing on the differences between the frameworks and how to do
 familiar things in Pyramid. It'll also cover add-on stuff like forms
 and auth, or at least list the alternatives available.

 I'm wondering if there are any particular questions people would like
 included. If so, please email them to me.

 Thanks a lot for that Mike.

 I've been pluging in WSGI apps in Pylons controllers, as described
 at 
 http://pylonsbook.com/en/1.1/the-web-server-gateway-interface-wsgi.html#wsgi-in-pylons-controllers.
 I'd be very interested to know if and how this can be done in a
 Pyramid application.


 Like this: http://docs.pylonsproject.org/projects/pyramid/dev/api/wsgi.html

 Also since a view can return a Response object you can do that:

 def my_wiew(request):
     request.path_info_pop() # if needed
     return request.get_response(wsgiapp)

 I use it to serve mercurial's hgweb apps and it just work.


Nice. I'll give it a try. Thanks Gael.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: [pyramid] why zope.sqlalchemy?

2011-01-13 Thread Eric Lemoine
On Wednesday, January 12, 2011, Chris McDonough chr...@plope.com wrote:
 On Wed, 2011-01-12 at 22:30 +0100, Eric Lemoine wrote:
 Hi

 In the SQLAlchemy + URL Dispatch Wiki tutorial zope.sqlalchemy and
 its ZopeTransactionExtension are used. The pyramid_routesalchemy Paste
 template also configures the application's Session with the
 ZopeTransactionExtension. Is this extension actually required? If not
 why do the tutorial and pyramid_routesalchemy make use of it?

 The intent is to provide a single point of commit responsibility, an
 automation of a commit for a successful request and a rollback for a
 request that causes an exception.  The actual technology used to do that
 is not really really that important; it happens to be repoze.tm2 and
 ZopeTransactionExtension.

 If you want the double whammy of inconvenience of not having your
 changes committed for you and you want to write code that commits before
 the request is finished (perhaps too early, when the request isn't
 actually known to be successful), you can disable it. ;-)

Ok thanks. I'm curious to know what the pyramid_sqla package uses.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



[pyramid] why zope.sqlalchemy?

2011-01-12 Thread Eric Lemoine
Hi

In the SQLAlchemy + URL Dispatch Wiki tutorial zope.sqlalchemy and
its ZopeTransactionExtension are used. The pyramid_routesalchemy Paste
template also configures the application's Session with the
ZopeTransactionExtension. Is this extension actually required? If not
why do the tutorial and pyramid_routesalchemy make use of it?

Thanks a lot,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



pyramid.exceptions.Forbidden question

2011-01-06 Thread Eric Lemoine
Hi

So in Pyramid we have the Forbidden exception (and its associated
built-in view). I've been surprised that raising Forbidden results in
a 401 response, given the name of the exception I'd have expected a
403 response. So I find the exception name misleading, no?

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: redirect helper?

2010-12-29 Thread Eric Lemoine
On Tuesday, December 28, 2010, Chris McDonough chr...@plope.com wrote:
 On Tue, 2010-12-28 at 22:35 +0100, Eric Lemoine wrote:
 Hello

 Does Pyramid provide a helper for issuing redirects? I've found
 nothing in the docs about that. Maybe pyramid_routehelper will provide
 that?

 Hi Eric,

 http://docs.pylonshq.com/pyramid/dev/narr/views.html#using-a-view-callable-to-do-an-http-redirect

Thanks. I'm used to Pylons' redirect function, so I didn't think about
looking at pyramid.httpexceptions. Until now I've used
Response(status=302, location=...), but feared that my Response misses
things. I should look at the code of HTTPFound.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



jsonify

2010-07-28 Thread Eric Lemoine
Hello

Does anyone know why jsonify does

response.headers[Content-Type] = application/json

instead of

response.content_type = application/json

Is there a good reason for that?

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: jsonify

2010-07-28 Thread Eric Lemoine
On Wed, Jul 28, 2010 at 12:37 PM, Gael Pasgrimaud g...@gawel.org wrote:
 On Wed, Jul 28, 2010 at 11:03 AM, Eric Lemoine
 eric.lemo...@camptocamp.com wrote:
 Hello

 Does anyone know why jsonify does

 response.headers[Content-Type] = application/json

 instead of

 response.content_type = application/json

 Is there a good reason for that?

 I don't think. That's two way to get exactly the same result.
 You probably win 0.0001s by setting the headers key directly.

Thanks Gaël.

For the record, my question was related to a ticket I was working on.
See http://pylonshq.com/project/pylonshq/ticket/632. I've got a
patch that I deem ready for review.


-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



WebTest 1.2.1 issue with cookie

2010-05-13 Thread Eric Lemoine
Hello

My app's functional tests fail with WebTest 1.2.1, because auth
cookies aren't set in the requests. I use repoze.who and what. Someone
reported the issue on stackoverflow, see
http://stackoverflow.com/questions/2731907/unit-testing-authorization-in-a-pylons-app-fails-cookies-arent-been-correctly-s.
Is it a known problem? Is there a workaround (other than downgrading
to WebTest 1.2?

Thanks for any response,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: WebTest 1.2.1 issue with cookie

2010-05-13 Thread Eric Lemoine
On Thu, May 13, 2010 at 8:03 PM, Eric Lemoine
eric.lemo...@camptocamp.com wrote:
 Hello

 My app's functional tests fail with WebTest 1.2.1, because auth
 cookies aren't set in the requests. I use repoze.who and what. Someone
 reported the issue on stackoverflow, see
 http://stackoverflow.com/questions/2731907/unit-testing-authorization-in-a-pylons-app-fails-cookies-arent-been-correctly-s.
 Is it a known problem? Is there a workaround (other than downgrading
 to WebTest 1.2?

I just tried WebTest trunk, and I have the same issue.

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



reference to app

2010-03-17 Thread Eric Lemoine
Hello

From a controller can I get a reference to the app (i.e. what's
returned by middleware.make_app)?

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: reference to app

2010-03-17 Thread Eric Lemoine
On Wed, Mar 17, 2010 at 8:10 PM, Mike Orr sluggos...@gmail.com wrote:
 On Wed, Mar 17, 2010 at 11:24 AM, Wyatt Baldwin
 wyatt.lee.bald...@gmail.com wrote:
 On Mar 17, 10:27 am, Eric Lemoine eric.lemo...@camptocamp.com wrote:
 Hello

 From a controller can I get a reference to the app (i.e. what's
 returned by middleware.make_app)?

 Right before `return app`, you could do `app_globals.app = app` (in
 fact, I think the docs for 1.0 say to do `config.app = app` anyway).

 I think Pylons did that as a kludge because it needed access to the
 app.  (The config initialization was reorganized to make it friendlier
 to nested applications, and apparently that severed the direct link
 between the app and some part of Pylons.)  I'm not sure if I like
 setting ``config.app`` that way, but I'm not sure it's necessarily bad
 either. ``config`` is where I'd look for the app if I were trying to
 find it.

 However... there's a potential issue here in that if you define
 filters or a pipeline in your paste config, the app returned by
 make_app will be wrapped with those other apps, so the one you saved
 won't be the root app, which may or may not matter for your
 scenario.

 Having said that, it seems to me that there *must* be another way to
 get at the root app, but I didn't dig very hard. I also ended up
 rewriting the code I had that utilized `app`. I'm not sure, but it
 might be a bad practice to use/need `app` in that way.

 Not sure about this.  Paste.composite is outside the realm of what the
 application code should be caring about?

In my case I think I'd like the root app. Here's what I am up to:
create a controller responsible for live-testing the application. So I
was thinking about something like that for this test controller:

class CheckerController(BaseController):

def index(self):
# creating test app
app = config[map] # ???
app = TestApp(map)

# test entry controller
response = app.get(url(controller='entry', action='index'))
assert app.js in response

# test print controller
response = app.get(url(controller='printer', action='info',
   var='printCapabilities'))
assert 'printCapabilities' in response
assert 'scales:[' in response

return green

Maybe I'm not taking a good direction, and I'd rather use urllib or
something and do actual HTTP requests to the application.

What do you think?

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Routes 1.12 issue

2010-03-02 Thread Eric Lemoine
On Monday, March 1, 2010, Ben Bangert b...@groovie.org wrote:
 On Mar 1, 2010, at 9:42 AM, Eric Lemoine wrote:

 I have a problem since Routes 1.12 was uploaded to pypi:

 I do url_for(action=myaction) in one of my controllers. With Routes
 1.11 it returns the URL to the controller's myaction action. With
 Routes 1.12 I get an exception saying that the URL cannot be derived.
 url_for(controller=mycontroller, action=action) works with 1.12,
 but I've been trying to avoid duplicating names.

 If this is a problem with my code how should I change it?

 The defaults in Routes have changed with regards to explicit behavior. You 
 can restore the old handling by setting:
 map.explicit = False

 in your config/routing.py file after the mapper object is created. 
 Minimization also now defaults to false, so you'll also need:
 map.minimization = True

 If you want that behavior. Since 0.9.7, recommended use has been with 
 minimization to False, and one should use url rather than url_for, the latter 
 of which is being deprecated and will be removed in Routes 2.0.

Thanks!

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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.



Routes 1.12 issue

2010-03-01 Thread Eric Lemoine
Hi

I have a problem since Routes 1.12 was uploaded to pypi:

I do url_for(action=myaction) in one of my controllers. With Routes
1.11 it returns the URL to the controller's myaction action. With
Routes 1.12 I get an exception saying that the URL cannot be derived.
url_for(controller=mycontroller, action=action) works with 1.12,
but I've been trying to avoid duplicating names.

If this is a problem with my code how should I change it?

Also, FYI, while researching the problem I launched paster shell and
did url_for(action=foo). With 1.11 I get /context/foo, while I get
an exception with Routes 1.12.

Thanks for any help on this,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

-- 
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: Plugin architecture

2009-04-27 Thread Eric Lemoine

On Sunday, April 26, 2009, Gael Pasgrimaud g...@gawel.org wrote:

 On Sun, Apr 26, 2009 at 10:19 PM, Kless jonas@googlemail.com wrote:

 Does Pylons is going to build a plugin system for that can be easily
 shared/re-used the applications? As is made in Django.


 You can already plug any wsgi application/middleware to pylons. see
 http://pylonshq.com/docs/en/0.9.7/wsgi_support/

 So i don't see the need of a plugin system. That's why wsgi is made for.

What about a plugin system where plugins would provide Pylons
controllers and routes (to these controllers)? So someone who has
developed a general-interest controller could distribute for others to
use it in their Pylons apps.

--
Eric

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



port number

2009-04-14 Thread Eric Lemoine

Hello

I want to use

[server:main]
use = egg:Paste#http
host = 0.0.0.0
port = 0

so that my Pylons app's port number is assigned for me.

Now, from my app's make_app() function do I have a way to know what
port number has actually been assigned?

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemo...@camptocamp.com
http://www.camptocamp.com

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



repoze.who CAS plugin

2009-03-16 Thread Eric Lemoine

Hello

Does anyone know if there's a repoze.who plugin for CAS (Central
Authentication Service)?

Thanks,
--
Eric

--~--~-~--~~~---~--~~
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: repoze.who CAS plugin

2009-03-16 Thread Eric Lemoine

Thanks for response Gustavo.

Eric

2009/3/16, Gustavo Narea m...@gustavonarea.net:
 On Monday March 16, 2009 16:15:17 Eric Lemoine wrote:
 Does anyone know if there's a repoze.who plugin for CAS (Central
 Authentication Service)?

 Not yet.

 But if you want, you can create it by reading the repoze.who docs and
 posting
 your questions (if any) to the Repoze mailing list (or joining #repoze on
 Freenode).

 HTH,
 --
 Gustavo Narea xri://=Gustavo.
 | Tech blog: =Gustavo/(+blog)/tech  ~  About me: =Gustavo/about |


-- 
Envoyé avec mon mobile

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Routes wildcards issue

2009-02-15 Thread Eric Lemoine

Hi

The Pylons Book gives an example of using a wildcard in a route. The
example fails with Routes-1.10.3.

 def controller_scan(directory=None):
 return ['error', 'page']
...
 from routes import Mapper
 map = Mapper(controller_scan=controller_scan)
 map.minimization = False
 map.connect('/wiki/{controller}/{action}/{*url}')
 print map.match('/wiki/page/view/some/variable/depth/file.html')
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/tmp/env/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/mapper.py,
line 318, in match
result = self._match(url)
  File 
/tmp/env/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/mapper.py,
line 270, in _match
self.create_regs()
  File 
/tmp/env/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/mapper.py,
line 237, in create_regs
self._create_regs(*args, **kwargs)
  File 
/tmp/env/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/mapper.py,
line 251, in _create_regs
route.makeregexp(clist)
  File 
/tmp/env/lib/python2.5/site-packages/Routes-1.10.3-py2.5.egg/routes/route.py,
line 287, in makeregexp
self.regmatch = re.compile(reg)
  File /usr/lib/python2.5/re.py, line 188, in compile
return _compile(pattern, flags)
  File /usr/lib/python2.5/re.py, line 241, in _compile
raise error, v # invalid expression
sre_constants.error: bad character in group name


Does anyone know what the problem is?

Thanks,

--
Eric

--~--~-~--~~~---~--~~
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: debug var and templates

2009-02-11 Thread Eric Lemoine

On Wed, Feb 11, 2009 at 9:02 AM, Mike Orr sluggos...@gmail.com wrote:
 I personally validate and change the types of the config vars in
 environment.py.  That way if there's a missing or incorrect variable
 it'll cause an error at startup rather than only in certain request
 situations.

Makes great sense.


 I didn't do any particular to be able to access the Pylons config
 object from my template, how does Pylons make it available for me?

 All the Pylons context variables are put in the template namespace
 implicitly.  c, app_globals (g), config, session, cache, url.  And h
 of course.

It seems I don't have app_globals or g available in the template
namespace, I had to use config[pylons.app_globals] instead. Am I
missing something?

Thanks a lot,


--
Eric

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



debug var and templates

2009-02-10 Thread Eric Lemoine

Hi

Some simple questions related to the debug var defined in the
development.ini file:

(1) Why is this variable defined using set? Other variables in the
development.ini file aren't defined using set, so what does make
debug a special case?

(2) I need to test whether the debug var is set in a Mako template, I
do it as follows:

% if config[debug]:
blabla
% else:
blabla
% endif

is it the correct way? Or should I use asbool(config[debug]) as done
in middleware.py? If so how can I make the asbool function available
in my template?

I didn't do any particular to be able to access the Pylons config
object from my template, how does Pylons make it available for me?

Thanks a lot,

--
Eric

--~--~-~--~~~---~--~~
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: Is Django more popular than Pylons?

2009-01-27 Thread Eric Lemoine

Hi

I agree that it'd be good to have virtualenv shipped with Python. I
wish I did have to tell my Pylons application users to first download
virtualenv, dearchive it, extract virtualenv.py, etc.

Cheers,

Eric

2009/1/27, Mike Orr sluggos...@gmail.com:

 On Tue, Jan 27, 2009 at 1:40 PM, Akira Kitada akit...@gmail.com wrote:

 Just a few questions.

 I hate to pass the buck, but this is Python's fault for not having
 reliable package management built in.  There's nothing Pylons can do
 about it except switch to another programming language.

 What programming language has a reliable package management system built
 in?
 Why do you think distutils is not reliable?

 Isn't it enough to use the package management systen you system provides
 when you need complete and rigorous one?

 That's what Guido says, and it's why we're at an impasse.  Distutils
 is fine if you just need to download one or two packages and python
 setup.py install them.  But that doesn't scale when a package has a
 dozen dependencies that recursively have dependencies.  Without
 Setuptools, Python and TurboGears couldn't exist, and Zope and Twisted
 would not have been able to split themselves into several packages.
 People coming to Python from Perl and Ruby expect to be able to just
 run a command to download and install a package.  That problem was
 solved ten years ago, so why does Python still not have it standard?

 If Setuptools and Virtualenv or the equivalent were built into Python,
 you could trust that every computer that has successfully installed
 Python can install packages and make virtual environments the same
 way.  That would eliminate 2/3 of the problems users have when
 installing Pylons, and the subsequent need to explain the problems and
 workarounds in the installation docs.  And the problems are different
 on Windows vs Mac vs Linux, and App Engine adds another dimension.  At
 work people say, Half the trouble of Pylons is installing it, and I
 often have to help them install it in person because otherwise they
 get stuck at some error message and have no idea what to do.

 --
 Mike Orr sluggos...@gmail.com

 


--~--~-~--~~~---~--~~
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: Django or Pylons - comparison details

2009-01-19 Thread Eric Lemoine

On Mon, Jan 19, 2009 at 10:29 PM, Wyatt Baldwin
wyatt.lee.bald...@gmail.com wrote:

 On Jan 19, 9:20 am, Colin Flanagan quadvill...@yahoo.com wrote:
 The SQLAlchemy argument is a very compelling one.  I have an application 
 that, while being a CMS, has heavily relational data.  I was urged by 
 different people to do it either in Django or Plone, but went with Pylons. 
 My domain objects are far easier to work with, though I did suffer from the 
 authentication layer and a few other things I had to build from scratch.

 Django can use SQLAlchemy, but by doing so you pretty much nullify a lot of 
 the things that are unique to that framework like their automatic admin 
 interfaces.  Django's  object generation came nowhere near understanding my 
 moderately-complicated data model and would have been much more difficult to 
 develop with, as compared to Pylons with SQLAlchemy.

 On another note:
 I find it interesting that a lot of people recommend Django for CMS-type 
 applications.  I would think that Plone might be more far more suitable 
 given that:
 1. your data fits well with the hierarchical structure of the ZODB
 2. your content is comparable to the content types already established in 
 Plone
 3. you don't have any legacy data or need to integrate with other systems
 4. you don't need to do lots of custom UI/presentation layer work

 I'm no Plone expert, but I don't think #4 is a problem for Plone. I
 think there are actually quite a few Plone sites with custom UIs (my
 company's new Intranet being one of them).

 And just to add another voice to this SQLAlchemy hurrah, like Colin,
 I'm also doing (complex) GIS stuff with PostGIS ( Shapely  GeoJSON 
 PyProj). Having a bit of experience with both Django and Rails, I
 don't know how I'd accomplish with their ORMs what I can with SA. I'm
 not saying it's not possible, but it seems nowhere near as
 straightforward or flexible.

 I'm also using Pylons/SA with a big, ugly, legacy Oracle schema. Fun,
 fun, fun.

 PS If anyone needs an SA type def for PostGIS geometry columns, give
 me a shout. I have one version based on PCL and another on Shapely.

Hi,

We also have this in MapFish.
https://trac.mapfish.org/trac/mapfish/browser/trunk/MapFish/server/python/mapfish/sqlalchemygeom.py

--
Eric

--~--~-~--~~~---~--~~
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: mod_wsgi and virtualenv

2008-11-11 Thread Eric Lemoine

Hi. We do use mod_wsgi and virtualenv in MapFish, and have a wiki page
documenting this. Check out
http://trac.mapfish.org/trac/mapfish/wiki/HowToMapFishServerApache.
Hope this helps.

Eric

2008/11/10, Christoph Haas [EMAIL PROTECTED]:
 Hi,

 I'm trying to deploy a Pylons app via mod_wsgi (Apache). That works so far.
 But I want to use a virtualenv directory and can't find any documentation
 on it. I found something for workingenv but don't know how to translate
 that to virtualenv.

 http://code.google.com/p/modwsgi/wiki/VirtualEnvironments said something
 about WSGIPythonHome but that can't be defined per virtual host. So I
 would have to use the very same virtualenv directory for all deployed
 applications (which is pretty absurd).

 I also found
 http://pypi.python.org/pypi/virtualenv#using-virtualenv-without-bin-python
 but that just prints these lines into Apache's error.log:

 
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21] mod_wsgi
 (pid=26216): Target WSGI script '/etc/apache2/screenshots.debian.net.wsgi'
 cannot be loaded as Python module.
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21] mod_wsgi
 (pid=26216): Exception occurred processing WSGI
 script '/etc/apache2/screenshots.debian.net.wsgi'.
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21] Traceback (most
 recent call last):
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]
 File /etc/apache2/screenshots.debian.net.wsgi, line 8, in module
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]
 execfile(activate_this, dict(__file__=activate_this))
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]
 File /home/debshots/bin/activate, line 4
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]  deactivate ()
 {
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]
 ^
 [Mon Nov 10 13:12:23 2008] [error] [client 80.85.196.21]  SyntaxError:
 invalid syntax
 

 Seems like it can't run virtualenv's 'activate' script like that. :(

 Any ideas?

 Kindly
  Christoph


--~--~-~--~~~---~--~~
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: AuthKit

2008-11-11 Thread Eric Lemoine

Hi James

To give you some context: I'm one of the developers of the MapFish
project. See http://www.mapfish.org. MapFish is a Pylons-based
framework for building web-mapping applications.

MapFish being based on Pylons, we're interested in Pylons itself,
SQLAlchemy and AuthKit.

AuthKit becoming central in MapFish, and if AuthKit lacks resources,
I'd personally be interested in being more involved its dev and
maintainance.

Eric


2008/11/6, James Gardner [EMAIL PROTECTED]:

 Hi Eric,

 It isn't that it hasn't received any attention, rather that I need to
 be sure your patch won't break other functionality. I've released
 AuthKit 0.4.1 which mirrors the current trunk and started working on
 applying the patches but for the next week or two I'm going to be
 completely busy with the final proof-reads of the Pylons Book so I'm
 not going to be able to test your patch until then. If you know anyone
 who would like to help me maintain AuthKit I'd be happy to hear from
 them.

 Cheers,

 James


 On Nov 3, 9:18 am, Eric Lemoine [EMAIL PROTECTED] wrote:
 On Fri, Oct 31, 2008 at 7:41 PM, Walter Cruz [EMAIL PROTECTED] wrote:
  A new version was released some weeks ago.. What's the issue of yor
  ticket?

 Thanks for your response. Here's the ticket:
 http://authkit.org/trac/ticket/59

 --
 Eric
 


--~--~-~--~~~---~--~~
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: AuthKit

2008-11-03 Thread Eric Lemoine

On Fri, Oct 31, 2008 at 7:41 PM, Walter Cruz [EMAIL PROTECTED] wrote:
 A new version was released some weeks ago.. What's the issue of yor ticket?

Thanks for your response. Here's the ticket: http://authkit.org/trac/ticket/59

--
Eric

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



AuthKit

2008-10-31 Thread Eric Lemoine

Hi List,

We created a ticket with a patch attached to it in the AuthKit trac
about 3 months ago, and the ticket hasn't received any attention. Does
anyone know if there's still some activity on AuthKit? Do you have
advice on how to make this ticket and patch move forward?

Thanks,

--
Eric

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---