Re: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread John Smallberries

Ummm, again, this works just fine if I remove that no-op middleware
from the stack. The controller would then receive a populated POST
dictionary that includes a FieldStorage element from which it can read
the file contents. With the middleware in place, it's blank. Is there
something more the middleware should be doing? Is it my form that is
the problem? Here's some minimal html for a file upload form that
fails in the same way as the above:

html
body
form action=/test enctype=multipart/form-data method=post
input name=upload size=50 id=upload type=file
input  value=Submit type=submit
/form
/body
/html



On May 15, 2:22 pm, Ian Bicking i...@colorstudy.com wrote:
 Your request looks weird:

 On Fri, May 15, 2009 at 2:57 PM, John Smallberries

 welch.quietple...@gmail.com wrote:
  Logfile output from the above:

  2009-05-15 12:45:31 INFO  handling request POST /testform
  Accept: text/xml,application/xml,application/xhtml+xml,text/
  html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Accept-Encoding: gzip, deflate
  Accept-Language: en-us
  Cache-Control: max-age=0
  Connection: keep-alive
  Content-Length: -1
  Content-Type: multipart/form-data; boundary=
  WebKitFormBoundaryGA7kzcYGAhBstwLx

 So, it expects a form-data style body with the given boundary

  Host: localhost:5000
  Referer:http://localhost:5000/
  User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
  AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

  upload=FieldStorage%28%27sysdump%27%2C+%27Case_45815_sysdump-Woking-
  Bisley-20080702-163019.tgz%27%29case_number=

 But the request body is actually application/x-www-form-urlencoded

 --
 Ian Bicking  |  http://blog.ianbicking.org
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How setup (I guess) Pylons routes when app run under WSGIAlias /something

2009-05-18 Thread Jan Koprowski

I use mod_wsgi 2.5 under Apache 2.
My WSGI applications is in /home/username/public_wsgi/wsgi/myapp.wsgi
where public_wsgi is directory where i have production.ini file.
My myapp.wsgi file looks like follows:

-- myapp.wsgi --
WORKING_ENV = /home/username/public_wsgi
APP_CONFIG = /home/username/production.ini

import sys
sys.path.append(WORKING_ENV)

from paste.deploy import loadapp
application = loadapp(config: + APP_CONFIG)
-- myapp.wsgi --

All looks working right when Pylons app runing under / address like
something.server.com/ but my app is hosted in server.com/something.
Apache configuration of WSGI:

-- WSGI apache config.py --
WSGIScriptAlias /panel /home/username/public_wsgi/wsgi/myapp.wsgi
WSGIDaemonProcess username user=username group=username processes=7
threads=17 display-name=wsgi:appname python-eggs=/username/public_wsgi/
data/eggs-cache
WSGIProcessGroup username
Directory /home/username/public_wsgi/wsgi
  Order deny,allow
  Allow from all
/Directory
-- WSGI apache config.py --

DocumentRoot for this serwer is set to /some/path/to/www and i don't
want change this. But after I host Pylons app under server.com/
something i get following errors in apache logs

File does not exist: /some/path/to/www/stylesheets, referer:
http://server.com/something/controllername/actionname
File does not exist: /some/path/to/www/images, referer:
http://server.com/something/controllername/actionname

My routing.py file:

-- routing.py --
Routes configuration

The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/

from pylons import config
from routes import Mapper

def make_map():
Create, configure and return the routes Mapper
map = Mapper(directory=config['pylons.paths']['controllers'],
 always_scan=config['debug'])
map.minimization = False

# The ErrorController route (handles 404/500 error pages); it
should
# likely stay at the top, ensuring it can always be resolved
map.connect('/error/{action}', controller='error')
map.connect('/error/{action}/{id}', controller='error')

# CUSTOM ROUTES HERE

map.connect('/', controller='account', action='index')
map.connect('/{controller}/{action}')
map.connect('/{controller}/{action}/{id}')

return map
-- routing.py --

What i should change to get working images/stylsheets links which
should bet getting from /home/username/public_wsgi/projectname/public
not DocumentRoot

Greetings from Poland
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



kill_hung_threads hangs the application

2009-05-18 Thread Ranjan

Hi All,

While running a TG2 application from console, often I get the
following message and then the application hangs:

02:20:13,297 INFO  [paste.httpserver.ThreadPool] kill_hung_threads
status: 10 threads (0 working, 10 idle, 0 starting) ave time N/A, max
time 0.00sec, killed 0 workers

Then, again I need to press Ctrl-C and restart my application.

Unable to guess how to resolve the issue. Needing help.

thanks,
Ranjan

--~--~-~--~~~---~--~~
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: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread Ian Bicking

Oh, it just occurred to me what's happening.  WebOb is not replacing
the body with an equivalent body; it tries to put back a
lazily-recreated body that matches the original body when it parses
the POST request, but it only works for application/x-www-urlencoded,
not multipart/form-data.  A not very great fix is just accessing
req.body, and it should save the body verbatim when that attribute is
accessed.  Otherwise WebOb needs to recreate the body more correctly.

What's odd is that usually this isn't a problem because WebOb puts the
parsed fields in a special key in environ, and then just uses that
instead of reparsing the body.  I'm not sure why that isn't happening,
or even why the request body is being parsed in this particular case.


On Mon, May 18, 2009 at 1:38 AM, John Smallberries
welch.quietple...@gmail.com wrote:

 Ummm, again, this works just fine if I remove that no-op middleware
 from the stack. The controller would then receive a populated POST
 dictionary that includes a FieldStorage element from which it can read
 the file contents. With the middleware in place, it's blank. Is there
 something more the middleware should be doing? Is it my form that is
 the problem? Here's some minimal html for a file upload form that
 fails in the same way as the above:

 html
 body
 form action=/test enctype=multipart/form-data method=post
 input name=upload size=50 id=upload type=file
 input  value=Submit type=submit
 /form
 /body
 /html



 On May 15, 2:22 pm, Ian Bicking i...@colorstudy.com wrote:
 Your request looks weird:

 On Fri, May 15, 2009 at 2:57 PM, John Smallberries

 welch.quietple...@gmail.com wrote:
  Logfile output from the above:

  2009-05-15 12:45:31 INFO  handling request POST /testform
  Accept: text/xml,application/xml,application/xhtml+xml,text/
  html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
  Accept-Encoding: gzip, deflate
  Accept-Language: en-us
  Cache-Control: max-age=0
  Connection: keep-alive
  Content-Length: -1
  Content-Type: multipart/form-data; boundary=
  WebKitFormBoundaryGA7kzcYGAhBstwLx

 So, it expects a form-data style body with the given boundary

  Host: localhost:5000
  Referer:http://localhost:5000/
  User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us)
  AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

  upload=FieldStorage%28%27sysdump%27%2C+%27Case_45815_sysdump-Woking-
  Bisley-20080702-163019.tgz%27%29case_number=

 But the request body is actually application/x-www-form-urlencoded

 --
 Ian Bicking  |  http://blog.ianbicking.org
 




-- 
Ian Bicking  |  http://blog.ianbicking.org

--~--~-~--~~~---~--~~
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: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread Wyatt Baldwin

On May 17, 11:38 pm, John Smallberries welch.quietple...@gmail.com
wrote:
 Ummm, again, this works just fine if I remove that no-op middleware
 from the stack. The controller would then receive a populated POST
 dictionary that includes a FieldStorage element from which it can read
 the file contents. With the middleware in place, it's blank. Is there
 something more the middleware should be doing?

I'm curious why you are creating a new Request.
--~--~-~--~~~---~--~~
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: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread John Smallberries

Ian: I'm truly stumped (I'd already tried reading/stashing the body at
once after seeing discussions about -1 content lengths, and also
reading from environ['wsgi.input'], all with the same behavior). I'm
not married to my particular code here -- what's the usual way someone
succeeds in propagating a FieldStorage past WebOb middleware? The
thing I'm writing does something interesting with GETs, and should
pass POST's through unmolested.

Wyatt: It's not a new request, it's a WebOb wrapper around the WSGI
environ:
http://pythonpaste.org/webob/reference.html#id1


--~--~-~--~~~---~--~~
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: How setup (I guess) Pylons routes when app run under WSGIAlias /something

2009-05-18 Thread Marius Gedminas
On Mon, May 18, 2009 at 06:39:41AM -0700, Jan Koprowski wrote:
 I use mod_wsgi 2.5 under Apache 2.
 My WSGI applications is in /home/username/public_wsgi/wsgi/myapp.wsgi
 where public_wsgi is directory where i have production.ini file.
 My myapp.wsgi file looks like follows:
 
 -- myapp.wsgi --
 WORKING_ENV = /home/username/public_wsgi
 APP_CONFIG = /home/username/production.ini
 
 import sys
 sys.path.append(WORKING_ENV)
 
 from paste.deploy import loadapp
 application = loadapp(config: + APP_CONFIG)
 -- myapp.wsgi --
 
 All looks working right when Pylons app runing under / address like
 something.server.com/ but my app is hosted in server.com/something.
 Apache configuration of WSGI:
 
 -- WSGI apache config.py --
 WSGIScriptAlias /panel /home/username/public_wsgi/wsgi/myapp.wsgi
 WSGIDaemonProcess username user=username group=username processes=7
 threads=17 display-name=wsgi:appname python-eggs=/username/public_wsgi/
 data/eggs-cache
 WSGIProcessGroup username
 Directory /home/username/public_wsgi/wsgi
   Order deny,allow
   Allow from all
 /Directory
 -- WSGI apache config.py --
 
 DocumentRoot for this serwer is set to /some/path/to/www and i don't
 want change this. But after I host Pylons app under server.com/
 something i get following errors in apache logs
 
 File does not exist: /some/path/to/www/stylesheets, referer:
 http://server.com/something/controllername/actionname
 File does not exist: /some/path/to/www/images, referer:
 http://server.com/something/controllername/actionname
 
 What i should change to get working images/stylsheets links which
 should bet getting from /home/username/public_wsgi/projectname/public
 not DocumentRoot

There are two parts to the solution:

  1. You have to generate correct URLs pointing to /panel/images/ and
 /panel/stylesheets.  This means using, e.g.
   img src=${url('/images/foo.png')} /
 instead of
   img src=/images/foo.png /
 It also means no static HTML files in your Pylons app public/
 folder, unless those files use relative URLs

  2. You have to tell your Pylons app that it lives at /panel and not at
 the website root.

 I don't know offhand how to do that with mod_wsgi.  Maybe it already
 does this automatically.  AFAIU it's a matter of setting
 SCRIPT_NAME and PATH_INFO correctly in the WSGI environment.

 I use Apache's mod_proxy + paster serve, and to get correct URLs from
 the Pylons app I have 

 [filter:proxy-prefix]
 use = egg:PasteDeploy#prefix
 prefix = /control_panel

 in my deployment.ini, and Apache has

 ProxyPass /control_panel http://localhost:5000/control_panel

As an alternative, you could put Alias directives in your apache config
and point /images and /stylesheets to your WSGI app's public directory.
If you're fine with the URLs being /images and /stylesheets without the
/panel prefix, and if you're sure you won't encounter the same problem
with other static resources in your app's public/ subdir.

Marius Gedminas
-- 
Hacking graphics in X is like finding sqrt(pi) with roman numerals.
-- man xdaliclock


signature.asc
Description: Digital signature


Re: How setup (I guess) Pylons routes when app run under WSGIAlias /something

2009-05-18 Thread Jan Koprowski



On 18 Maj, 20:07, Marius Gedminas mar...@gedmin.as wrote:
 As an alternative, you could put Alias directives in your apache config
 and point /images and /stylesheets to your WSGI app's public directory.
 If you're fine with the URLs being /images and /stylesheets without the
 /panel prefix, and if you're sure you won't encounter the same problem
 with other static resources in your app's public/ subdir.

Your idea really hit the bull's-eye. For me (so far) add h.url_for to
h.image, h.link_to, h.stylesheet_link and url_for to redirect_to
helps.

Greetings from Poland
--
Jan Koprowski
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



No secure_form token after use htmlfill.render with defaults.

2009-05-18 Thread Jan Koprowski

Hi !

  After i upgrade few Pylons packages elements related with Pylons i
get 403 CSRF error in function tests in my app. After look to form i
saw that when I use some default values to fill form and use
secure_form too _authentication_token is empty.

 controller -

def index(self):
form = render('/information/index.mako')

info = None
try:
info = Informations.fetch(session['userdata']['uid'])
except ZhradminNoResults:
return form

return formencode.htmlfill.render(
form,
defaults = info
)
 controller -

 template -
${h.secure_form(h.url_for('/information/update'), method='post')}
${h.end_form()}
 template -

 site source -
form action=/information/update method=post
div style=display: none;input name=_authentication_token
type=hidden value= //div
 site source -

Is this a bug or it is normally and i should just do worakround and
get some random string in controller for info._authentication_token
by my own and do all this strange stuff for @authenticate_form ?

Greetings from Poland
--
Jan Koprowski
--~--~-~--~~~---~--~~
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: How setup (I guess) Pylons routes when app run under WSGIAlias /something

2009-05-18 Thread Jan Koprowski

Not exactly. I have problem on the begining. after i write server.com/
something i am rewritng to server.com/controller/actionname - after i
fix this in url all work good.

Greetings from Poland
--
Jan Koprowski
--~--~-~--~~~---~--~~
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: No secure_form token after use htmlfill.render with defaults.

2009-05-18 Thread Marius Gedminas
On Mon, May 18, 2009 at 11:47:34AM -0700, Jan Koprowski wrote:
   After i upgrade few Pylons packages elements related with Pylons i
 get 403 CSRF error in function tests in my app. After look to form i
 saw that when I use some default values to fill form and use
 secure_form too _authentication_token is empty.
 
  controller -
 
 def index(self):
 form = render('/information/index.mako')
...
 return formencode.htmlfill.render(
 form,
 defaults = info
 )

Try passing force_defaults=True to htmlfill.render().

  controller -
 
  template -
 ${h.secure_form(h.url_for('/information/update'), method='post')}
 ${h.end_form()}
  template -
 
  site source -
 form action=/information/update method=post
 div style=display: none;input name=_authentication_token
 type=hidden value= //div
  site source -
 
 Is this a bug or it is normally and i should just do worakround and
 get some random string in controller for info._authentication_token
 by my own and do all this strange stuff for @authenticate_form ?

htmlfill is quirky and I've never used secure_form, so I don't know
where the blame falls.

Marius Gedminas
-- 
I may not understand what I'm installing, but that's not my job. I
just need to click Next, Next, Finish here so I can walk to the next
system and repeat the process
-- Anonymous NT Admin


signature.asc
Description: Digital signature


Re: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread Ian Bicking

Can you avoid touching req.POST or req.params?  If you don't access
those attributes, no parsing of the request body will happen.  If you
just access req.GET you should be safe.


On Mon, May 18, 2009 at 12:57 PM, John Smallberries
welch.quietple...@gmail.com wrote:

 Ian: I'm truly stumped (I'd already tried reading/stashing the body at
 once after seeing discussions about -1 content lengths, and also
 reading from environ['wsgi.input'], all with the same behavior). I'm
 not married to my particular code here -- what's the usual way someone
 succeeds in propagating a FieldStorage past WebOb middleware? The
 thing I'm writing does something interesting with GETs, and should
 pass POST's through unmolested.

 Wyatt: It's not a new request, it's a WebOb wrapper around the WSGI
 environ:
 http://pythonpaste.org/webob/reference.html#id1


 




-- 
Ian Bicking  |  http://blog.ianbicking.org

--~--~-~--~~~---~--~~
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: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread Wyatt Baldwin

On May 18, 10:57 am, John Smallberries welch.quietple...@gmail.com
wrote:
 Ian: I'm truly stumped (I'd already tried reading/stashing the body at
 once after seeing discussions about -1 content lengths, and also
 reading from environ['wsgi.input'], all with the same behavior). I'm
 not married to my particular code here -- what's the usual way someone
 succeeds in propagating a FieldStorage past WebOb middleware? The
 thing I'm writing does something interesting with GETs, and should
 pass POST's through unmolested.

 Wyatt: It's not a new request, it's a WebOb wrapper around the WSGI
 environ:http://pythonpaste.org/webob/reference.html#id1

Yes. I was just curious why you were doing that, because accessing
request.POST directly would avoid this problem.
--~--~-~--~~~---~--~~
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 patch] breaks when passing a list of unicodes as extra args to generate()

2009-05-18 Thread Alexandre Conrad

Hi there,

I have forked the official Routes trunk, applied and pushed my changes
to my branch. Although, I'm not sure if patches should be provided
that way.

http://bitbucket.org/aconrad/routes/changeset/441be14adb55/

I first created a patch queue, but I'm not sure if it's meant for
that. Plus, I gotta hg qclone. I don't seem to have that on my
mercurial. I may have to read more literature on this.

Regards,
Alex

--~--~-~--~~~---~--~~
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: empty POST dictionary for post request when using webob.Request in middleware

2009-05-18 Thread John Smallberries

On May 18, 2:36 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote:
 Yes. I was just curious why you were doing that, because accessing
 request.POST directly would avoid this problem.

Do I have access to a pre-made request object at this point in the
stack? It's available once I'm down in a controller method, but
earlier than that using what you get by importing request from pylons
throws exceptions.TypeError: No object (name: request) has been
registered for this thread. The handful of WebOb examples I've seen
all begin by wrapping environ in a Request.




--~--~-~--~~~---~--~~
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: How setup (I guess) Pylons routes when app run under WSGIAlias /something

2009-05-18 Thread Graham Dumpleton



On May 19, 4:07 am, Marius Gedminas mar...@gedmin.as wrote:
 On Mon, May 18, 2009 at 06:39:41AM -0700, Jan Koprowski wrote:
  I use mod_wsgi 2.5 under Apache 2.
  My WSGI applications is in /home/username/public_wsgi/wsgi/myapp.wsgi
  where public_wsgi is directory where i have production.ini file.
  My myapp.wsgi file looks like follows:

  -- myapp.wsgi --
  WORKING_ENV = /home/username/public_wsgi
  APP_CONFIG = /home/username/production.ini

  import sys
  sys.path.append(WORKING_ENV)

  from paste.deploy import loadapp
  application = loadapp(config: + APP_CONFIG)
  -- myapp.wsgi --

  All looks working right when Pylons app runing under / address like
  something.server.com/ but my app is hosted in server.com/something.
  Apache configuration of WSGI:

  -- WSGI apache config.py --
  WSGIScriptAlias /panel /home/username/public_wsgi/wsgi/myapp.wsgi
  WSGIDaemonProcess username user=username group=username processes=7
  threads=17 display-name=wsgi:appname python-eggs=/username/public_wsgi/
  data/eggs-cache
  WSGIProcessGroup username
  Directory /home/username/public_wsgi/wsgi
    Order deny,allow
    Allow from all
  /Directory
  -- WSGI apache config.py --

  DocumentRoot for this serwer is set to /some/path/to/www and i don't
  want change this. But after I host Pylons app under server.com/
  something i get following errors in apache logs

  File does not exist: /some/path/to/www/stylesheets, referer:
 http://server.com/something/controllername/actionname
  File does not exist: /some/path/to/www/images, referer:
 http://server.com/something/controllername/actionname

  What i should change to get working images/stylsheets links which
  should bet getting from /home/username/public_wsgi/projectname/public
  not DocumentRoot

 There are two parts to the solution:

   1. You have to generate correct URLs pointing to /panel/images/ and
      /panel/stylesheets.  This means using, e.g.
        img src=${url('/images/foo.png')} /
      instead of
        img src=/images/foo.png /
      It also means no static HTML files in your Pylons app public/
      folder, unless those files use relative URLs

   2. You have to tell your Pylons app that it lives at /panel and not at
      the website root.

      I don't know offhand how to do that with mod_wsgi.  Maybe it already
      does this automatically.  AFAIU it's a matter of setting
      SCRIPT_NAME and PATH_INFO correctly in the WSGI environment.

Apache/mod_wsgi sets SCRIPT_NAME appropriately based on mount point
derived from WSGIScriptAlias directive. Pylon's should honour it
automatically if Pylons is doing the correct thing.

Graham

      I use Apache's mod_proxy + paster serve, and to get correct URLs from
      the Pylons app I have

          [filter:proxy-prefix]
          use = egg:PasteDeploy#prefix
          prefix = /control_panel

      in my deployment.ini, and Apache has

          ProxyPass /control_panelhttp://localhost:5000/control_panel

 As an alternative, you could put Alias directives in your apache config
 and point /images and /stylesheets to your WSGI app's public directory.
 If you're fine with the URLs being /images and /stylesheets without the
 /panel prefix, and if you're sure you won't encounter the same problem
 with other static resources in your app's public/ subdir.

 Marius Gedminas
 --
 Hacking graphics in X is like finding sqrt(pi) with roman numerals.
         -- man xdaliclock

  signature.asc
  1KViewDownload
--~--~-~--~~~---~--~~
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: No secure_form token after use htmlfill.render with defaults.

2009-05-18 Thread Jan Koprowski



On 18 Maj, 22:58, Marius Gedminas mar...@gedmin.as wrote:
 Try passing force_defaults=True to htmlfill.render().

Nothing. _authentication_token field is still empty.

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