h.url(controller, action)

2007-05-01 Thread Antipin Aleksei

Hi

I have IndexController serving index.html that has sugnin form. And I 
want forward username and password to AccountController.

${ h.start_form(h.url(action='login'), method='POST') } returns 
'index/login'

Adding controller parameter:
${ h.start_form(h.url(controller='account', action='login'), 
method='POST') } return this html:

form action=/login method=POST

If I use /account or /login than I get /account//login

Is it a bug or I'm doing wrong here?

-- 
Best regards,
Antipin Aleksei


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



Beaker 0.7dev-r67?

2007-05-01 Thread mitch

I have Pylons checked out from subversion.  My local copy was working
but I haven't used it in a couple of weeks.  So, I just did an update
and now I'm getting this error when running python setup.py develop:

No local packages or download links found for Beaker=0.7dev-r67
error: Could not find suitable distribution for
Requirement.parse('Beaker=0.7dev-r67')

The setup.py does indeed reference Beaker 0.7dev-r67 as a required
package but I can't find that version anywhere.  Is this just a
temporary anomaly that I'm seeing because I'm running out of
subversion?  Or is that dependency wrong?

Thanks,

Mitch


--~--~-~--~~~---~--~~
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 (Kid? Paste?) converting my XHTML to HTML

2007-05-01 Thread [EMAIL PROTECTED]

All my kid templates work great, but they seem to be parsed through
some kind of filter (pylons is using HTMLSerializer from Kid maybe?)
that converts all my tags into HTML 4.01 versions: title becomes
TITLE and img src=blah / becomes IMG SRC=blah

what is it that is doing this? Is there some way for me to switch it
to spit out XHTML? or just to preferably leave my code as I wrote it?
It worries me that the server is going through this extra conversion
process for every page it renders.

Cheers,
Ben


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



sending email

2007-05-01 Thread voltron

Hi,

Is there a specific way or helpers for sending mail in a controller in
Pylons, or do I just import the smtp lib for python and use that?


Thanks


--~--~-~--~~~---~--~~
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: Beaker 0.7dev-r67?

2007-05-01 Thread Ben Bangert

On May 1, 2007, at 8:09 AM, mitch wrote:

 I have Pylons checked out from subversion.  My local copy was working
 but I haven't used it in a couple of weeks.  So, I just did an update
 and now I'm getting this error when running python setup.py develop:

With the release of 0.9.5, there shouldn't be any reason to continue  
using the svn copy unless you want to help develop/patch Pylons bugs  
(which would be great).

 No local packages or download links found for Beaker=0.7dev-r67
 error: Could not find suitable distribution for
 Requirement.parse('Beaker=0.7dev-r67')

 The setup.py does indeed reference Beaker 0.7dev-r67 as a required
 package but I can't find that version anywhere.  Is this just a
 temporary anomaly that I'm seeing because I'm running out of
 subversion?  Or is that dependency wrong?

The dependency was specified incorrectly, I've updated it so that it  
will pull it in properly now. Note that Beaker had a major refactor  
and now has the caching/session code formerly from MyghtyUtils merged  
in. This shouldn't have any actual effect as all the unit tests are  
still passing.

Cheers,
Ben

--~--~-~--~~~---~--~~
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: Beaker 0.7dev-r67?

2007-05-01 Thread mitch

Thanks.  It is, indeed, working now.  I guess I don't have a good
reason at the moment for running out of subversion but if I start
moving full speed ahead with Pylons I would like to be in a position
to contribute.

Mitch

On May 1, 1:37 pm, Ben Bangert [EMAIL PROTECTED] wrote:
 On May 1, 2007, at 8:09 AM, mitch wrote:

  I have Pylons checked out from subversion.  My local copy was working
  but I haven't used it in a couple of weeks.  So, I just did an update
  and now I'm getting this error when running python setup.py develop:

 With the release of 0.9.5, there shouldn't be any reason to continue
 using the svn copy unless you want to help develop/patch Pylons bugs
 (which would be great).

  No local packages or download links found for Beaker=0.7dev-r67
  error: Could not find suitable distribution for
  Requirement.parse('Beaker=0.7dev-r67')

  The setup.py does indeed reference Beaker 0.7dev-r67 as a required
  package but I can't find that version anywhere.  Is this just a
  temporary anomaly that I'm seeing because I'm running out of
  subversion?  Or is that dependency wrong?

 The dependency was specified incorrectly, I've updated it so that it
 will pull it in properly now. Note that Beaker had a major refactor
 and now has the caching/session code formerly from MyghtyUtils merged
 in. This shouldn't have any actual effect as all the unit tests are
 still passing.

 Cheers,
 Ben


--~--~-~--~~~---~--~~
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: Serving static content

2007-05-01 Thread Cliff Wells

On Mon, 2007-04-30 at 10:34 -0700, voltron wrote:
 Thanks for your answers Cliff. I took a look at Nginx, it looks very
 interesting, would you care to post an example of your Nginx config
 file?

Here's a pretty basic setup that proxies to a Pylons backend and serves
static content from a particular directory:

# server section from nginx.conf
server { 
listen123.123.123.123:80;
server_name   www.example.com example.com;
access_log/var/log/nginx/example.com-access.log main;

location / {
proxy_pass  http://127.0.0.1:8080; # proxy to pylons app
include /etc/nginx/proxy.conf; # see below
}

# static content
location ~ ^/(images|javascript|css|flash|yui|yui-ext|downloads)/  {
root/var/www/public_html;
expires 30d;
}
location = /favicon.ico  {
root/var/www/public_html/images;
}
}


# proxy.conf - common to lots of vhosts
proxy_set_headerHost $host;
proxy_set_headerX-Real-IP $remote_addr;
proxy_set_headerX-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout  90;
proxy_read_timeout  90;
proxy_buffer_size   4k;
proxy_buffers   4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;


There's other examples on the Nginx wiki.

Regards,
Cliff


--~--~-~--~~~---~--~~
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: Formencode and Checkbox/Radio Groups

2007-05-01 Thread Graham Stratton

Hi Dan,

I've been struggling a bit with FormEncode too.  Here's some
controller code that almost works for me.  To make it work, I had to
change line 106 of pylons/decorators/__init__.py tp

response.content = [htmlfill.render(form_content, decoded, errors)]

(Passing 'decoded' instead of 'params', which haven't been through
variable_decode and therefore don't work with multiple values).  I'm
not sure whether this is a bug or whether I'm using the decorator
wrongly.

I also don't understand why my LengthOneValidator doesn't raise an
exception for zero items selected, but NotEmpty does.  I suspect it
will be obvious in the morning.

Sorry for the poor example.  I hope this helps a little.

Graham


from formencodedemo.lib.base import *
from formencode.schema import Schema
from formencode.foreach import ForEach
from formencode.compound import All
from formencode import validators
from formencode.api import Invalid

class LengthOneValidator(validators.FancyValidator):
def validate_python(self, value, state):
if len(value) != 1:
raise Invalid(Please select exactly one thingy, value,
state)

class DemoSchema(Schema):
n = All(ForEach(validators.Int()), LengthOneValidator(),
validators.NotEmpty())

class FormController(BaseController):
def index(self):
return Response(
form action=validate method=post
input type=checkbox name=n value=1 /1
input type=checkbox name=n value=2 /2
input type=checkbox name=n value=3 /3
input type=checkbox name=n value=4 /4
input type=submit /
/form)

@validate(schema=DemoSchema, form='index', variable_decode=True)
def validate(self):
return Response(str(self.form_result))


--~--~-~--~~~---~--~~
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: sending email

2007-05-01 Thread Shannon -jj Behrens

On 5/1/07, voltron [EMAIL PROTECTED] wrote:
 Hi,

 Is there a specific way or helpers for sending mail in a controllers
 in Pylons, or do I just import the smtp lib for python and use that?

I just use smtplib.

Best Regards,
-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Dave Kuhlman Pylons docs

2007-05-01 Thread Shannon -jj Behrens

On 4/29/07, voltron [EMAIL PROTECTED] wrote:
 The Pylons docs from Dave Kuhlman are excellent! These really cleared
 up my slightly hazy view of Pylons. In fact, almost all of the
 questions which I had lined up to ask, and those I have asked are
 discussed very clearly in it.

 Would the Pylons Dev consider adding a link from the Pylons page or
 even better, integrating some of the content in the Pylons tutorial
 and first steps?

 Link: http://www.rexx.com/~dkuhlman

I wonder if Dave would be willing to integrate them himself ;)
Patches often lead to commit rights (although, to be clear, I'm not in
charge).

Best Regards,
-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons Evaluation -Questions

2007-05-01 Thread Shannon -jj Behrens

Sorry, no.  Like I said, so far my approach is to avoid sessions as
long as possible so that I don't have to deal with it ;)

-jj

On 4/28/07, voltron [EMAIL PROTECTED] wrote:
 Oh, by the way, do you have a recipe or a URL to a tutorial  of Pylons
 using memcache?


 Thanks againf

 On Apr 28, 2:27 am, Shannon -jj Behrens [EMAIL PROTECTED] wrote:
  On 4/27/07, Cliff Wells [EMAIL PROTECTED] wrote:
 
   On Fri, 2007-04-27 at 16:50 -0700, Shannon -jj Behrens wrote:
 
It's the same as everything else.  You can add more Web servers.  If
you use sessions, you'll need to either a) use session stickiness
(ugly)
 
   Out of curiosity, how is this ugly?  This should be mostly handled
   transparently by the proxy (i.e. sends same sessions to same backend).
 
  If one Web server dies, all the users using that Web server lose their
  sessions.  That sucks.  It also limits the effectiveness of the load
  balancer.  It can only redistribute *new* users instead of each new
  request.
 
or b) use a session server (less ugly).
 
   And what do you recommend for this?
 
  If I had to make the decision today, I'd probably use memcache.
 
   I've not seen this approach, so I'm
   curious (or maybe the proxy acts as a session server, so we're talking
   about the same thing?).
 
  What do you mean the proxy acts as a session server?  I don't know of
  any load balancers who can act as session servers.
 
  By the way, this topic is covered nicely in Scalable Internet
  Architectures and Building Scalable Web Sites.
 
  (weird, de ja vu ;)
 
  Happy Hacking!
  -jj
 
  --http://jjinux.blogspot.com/


 



-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons Evaluation -Questions

2007-05-01 Thread Shannon -jj Behrens

Dan,

I'm pretty sure we're agreeing.

-jj

On 4/28/07, Dan [EMAIL PROTECTED] wrote:

  IMHO.  I never implemented memcache, but the distributed memory concept is
 *not* by itself scalable architecture.  The key is session data.  Typically
 (as in default Pylons setup) session data is tied to physical hardware...
 your web server.  To make use of memcache, one would first need to implement
 scalable architecture, such as the 'share nothing' approach.

  Again, I'm not claiming to be an expert on the 'share nothing'
 architecture, but my understanding is that 'share nothing' stores all data
 in the database... even session data.  This way, it doesn't matter what web
 server in your farm takes users requests.  They will all ask the database
 (the db will be your bottleneck) but at least they will *mostly* know how to
 access and store data.

  So the basic point to my post is that scalable architecture is more about
 theory than specific tools.   The theory behind building scalable web
 applications is a growing subject in system engineering that I find
 interesting.  You can check a decent article about myspace.com struggles at
 - http://www.baselinemag.com/article2/0,1540,2084131,00.asp

  'memcache' is a tool, when applied to a scalable architecture, could
 provide performance improvements.

  Dan


  Cliff Wells wrote:
  On Fri, 2007-04-27 at 17:27 -0700, Shannon -jj Behrens wrote:


  On 4/27/07, Cliff Wells [EMAIL PROTECTED] wrote:




  Out of curiosity, how is this ugly? This should be mostly handled
 transparently by the proxy (i.e. sends same sessions to same backend).

  If one Web server dies, all the users using that Web server lose their
 sessions. That sucks. It also limits the effectiveness of the load
 balancer. It can only redistribute *new* users instead of each new
 request.

  Ah. Makes sense. I guess reading books *does* help!





  or b) use a session server (less ugly).

  And what do you recommend for this?

  If I had to make the decision today, I'd probably use memcache.

  mmm. Memcached rocks.





  I've not seen this approach, so I'm
 curious (or maybe the proxy acts as a session server, so we're talking
 about the same thing?).

  What do you mean the proxy acts as a session server? I don't know of
 any load balancers who can act as session servers.

  I wasn't sure exactly what you meant by session server, but now I do.
 So you are correct. I was thinking perhaps you meant external process
 that maintains sessions across backends in which case some load
 balancers do.




  By the way, this topic is covered nicely in Scalable Internet
 Architectures and Building Scalable Web Sites.

 (weird, de ja vu ;)

  If only I had time to read actual books rather than bug people on the
 net for answers...


 Cliff





  



-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Registration app

2007-05-01 Thread Shannon -jj Behrens

On 4/28/07, voltron [EMAIL PROTECTED] wrote:
 Is there a recipe or a tutorial that someone could point me to on how
 to implement a registration and authentication app for users using
 pylons?

There's AuthKit.  I personally found it unsuitable for my needs so I
rolled my own.  I did make use of paste.auth.cookie which does cookie
signing to prove that someone is logged in without requiring a
session.

Best of Luck,
-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Pylons docs [was: Hold my hand, please]

2007-05-01 Thread Shannon -jj Behrens

On 4/28/07, Graham Higgins [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 On 28 Apr 2007, at 01:48, Shannon -jj Behrens wrote:

  It looks nice, but I fear so many people have written overviews of
  Pylons that I'm completely losing track. [ ... ]
 
  There's *tons* of good documentation for Pylons. [ ... ]
 
  We need to unify, *delete*, and make a plan for maintaining it.

 Okay, point taken. Deleted.

 It was a response to a specific plea. My dad used to say: If someone
 doesn't understand, then they haven't been told properly, it's a
 dictum that I've found difficult to gainsay.

 Cheers,

 Graham.

Sorry!  I didn't mean for you or anyone else in particular to delete
their documentation!  Rather, I was saying that it should be merged
and then the old versions deleted!

I hope I didn't offend you!

-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Registration app

2007-05-01 Thread Shannon -jj Behrens

On 5/1/07, Shannon -jj Behrens [EMAIL PROTECTED] wrote:
 On 4/28/07, voltron [EMAIL PROTECTED] wrote:
  Is there a recipe or a tutorial that someone could point me to on how
  to implement a registration and authentication app for users using
  pylons?

 There's AuthKit.  I personally found it unsuitable for my needs so I
 rolled my own.  I did make use of paste.auth.cookie which does cookie
 signing to prove that someone is logged in without requiring a
 session.

This just in--Ben said that a lot of work has gone into newer versions
of AuthKit, so my advice is likely stale.  Please ignore me ;)

Those sneaky open source coders--always working! ;)

http://docs.pythonweb.org/display/authkitcookbook/Home

Best Regards,
-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Upgrading to 0.9.5 - unicode issue

2007-05-01 Thread Robert Leftwich

Shannon -jj Behrens wrote:
 
 The following is even better:
 
 if isinstance(component, basestring)

Not sure if Mike is still taking patches for Myghty (the old technology!), but 
I'll see - if I didn't have 130 templates/components I would be moving sooner 
rather than later, to Mako or maybe even Breve as I find that approach 
intriguing/appealing.

 
 I think it's good policy to use Unicode objects all over the place
 inside your app and then either call str or .encode on the edges of
 your application.  It seems to me that it's better to use str when
 looking up the right component than it is to turn off unicode
 completely.

Agreed.

 
 My $0.02 (what's that in Australia?),

It used to be about $AU0.04, but what with the economic conditions in the US 
and 
AUS, as of yesterday it was $AU0.024119633 :-/

Robert


--~--~-~--~~~---~--~~
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: Session store

2007-05-01 Thread Shannon -jj Behrens

On 4/27/07, Cliff Wells [EMAIL PROTECTED] wrote:

 On Fri, 2007-04-27 at 17:24 -0700, Shannon -jj Behrens wrote:

  This topic is covered very nicely in Building Scalable Web Sites and
  Scalable Internet Architectures.

 Okay, one more plug for these books and there's going to be a demand for
 full disclosure ;-)

hahahaha

Nope, I don't have any connection to them.  It takes me so long to
read books that if I invest 3 months of train-reading-time, I want to
get as much mileage out of the knowledge as possible ;)

Happy Hacking!
-jj

-- 
http://jjinux.blogspot.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Sending intermediate content

2007-05-01 Thread ben adam

i can't get this to work with 0.9.5  i have debug set to false ??


On Aug 17 2006, 9:06 am, benchline [EMAIL PROTECTED] wrote:
 That did it.  After uncommenting that line and restarting the paster
 server the following function (slightly modified from the previous
 example to send all items to the browser) worked as expected sending
 eachyieldstatement output to the browser immediately.

 def test(self):
 import time
 req = request.current_obj()
 def long_func():
 env = req.environ
yield'I am starting now'
 for i in range(100):
yieldbr%s % i
 time.sleep(.1)
yield'I should be finishing now'
 res = Response()
 res.content = long_func()
 return res

 Thanks Ben.

 Paul

 Ben Bangert wrote:
  I should mention that due to how debug mode catches the info
  should an exception be caught, you can only send a stream when debug
  mode is off.

  Try uncommenting the
  set debug = false

  At the bottom of the development.ini file, and let me know if the
  iterator works.


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