Christopher Zorn | 1 May 2005 17:34
Picon

livepage

Hey, I was using livepage through a proxy. I had to make a small change to get
it to work, I just want to let you guys know.

def render_liveglue(self, ctx, data):
   #return tags.script(src=url.here.child('nevow_glue.js'))
   return tags.script(src='nevow_glue.js')

url.here gave the url that was on the server behind the firewall.
Thomas HERVE | 1 May 2005 18:45
Picon
Favicon

Re: livepage

Quoting Christopher Zorn <christopher.zorn <at> gmail.com>:

> Hey, I was using livepage through a proxy. I had to make a small 
> change to get
> it to work, I just want to let you guys know.
>
> def render_liveglue(self, ctx, data):
>   #return tags.script(src=url.here.child('nevow_glue.js'))
>   return tags.script(src='nevow_glue.js')
>
> url.here gave the url that was on the server behind the firewall.

As I was the first to make this mistake, I'll answer : if you use Nevow 
behing a
proxy (really, it's a proxy ? what did you mean by firewall ?), you 
should look
after nevow.vhost.VHostMonsterResource.

Good luck,

--

-- 
Thomas
Christopher Zorn | 2 May 2005 03:31
Picon

Re: livepage

On 5/1/05, Thomas HERVE <therve <at> free.fr> wrote:
> Quoting Christopher Zorn <christopher.zorn <at> gmail.com>:
> 
> > Hey, I was using livepage through a proxy. I had to make a small
> > change to get
> > it to work, I just want to let you guys know.
> >
> > def render_liveglue(self, ctx, data):
> >   #return tags.script(src=url.here.child('nevow_glue.js'))
> >   return tags.script(src='nevow_glue.js')
> >
> > url.here gave the url that was on the server behind the firewall.
> 
> As I was the first to make this mistake, I'll answer : if you use Nevow
> behing a
> proxy (really, it's a proxy ? what did you mean by firewall ?), you
> should look
> after nevow.vhost.VHostMonsterResource.

Sorry, a reverse proxy. I have an apache reverse proxy to get to the server
running the nevow livepage application. How will
nevow.vhost.VHostMonsterResource
fix this? 

The problem is, when I call render_liveglue it gives a tag similar to
<script src=http://server.behind.the.firewall.tld/nevow_glue.js />

It needs to be the correct server or just nevow_glue.js in order to
work correctly.

(Continue reading)

Tommi Virtanen | 2 May 2005 06:48

Re: livepage

Christopher Zorn wrote:
>>As I was the first to make this mistake, I'll answer : if you use Nevow
>>behing a
>>proxy (really, it's a proxy ? what did you mean by firewall ?), you
>>should look
>>after nevow.vhost.VHostMonsterResource.
> 
> Sorry, a reverse proxy. I have an apache reverse proxy to get to the server
> running the nevow livepage application. How will
> nevow.vhost.VHostMonsterResource
> fix this? 
> 
> The problem is, when I call render_liveglue it gives a tag similar to
> <script src=http://server.behind.the.firewall.tld/nevow_glue.js />
> 
> It needs to be the correct server or just nevow_glue.js in order to
> work correctly.

Just wanted to confirm this quickly: you must use VHostMonsterResource,
and the code change you suggested is not needed. Without
VHostMonsterResource, many other things will fail too; first you are
likely to notice are redirects.

To all nevow developers:

On the other hand, if you want to link to a resource in the current
directory, url.here is really unnecessary -- please try to use relative
URLs when they work.
Matt Goodall | 2 May 2005 13:13

Re: livepage

Tommi Virtanen wrote:

> Christopher Zorn wrote:
>
>>> As I was the first to make this mistake, I'll answer : if you use Nevow
>>> behing a
>>> proxy (really, it's a proxy ? what did you mean by firewall ?), you
>>> should look
>>> after nevow.vhost.VHostMonsterResource.
>>
>>
>> Sorry, a reverse proxy. I have an apache reverse proxy to get to the
>> server
>> running the nevow livepage application. How will
>> nevow.vhost.VHostMonsterResource
>> fix this?
>> The problem is, when I call render_liveglue it gives a tag similar to
>> <script src=http://server.behind.the.firewall.tld/nevow_glue.js />
>>
>> It needs to be the correct server or just nevow_glue.js in order to
>> work correctly.
>
>
> Just wanted to confirm this quickly: you must use VHostMonsterResource,
> and the code change you suggested is not needed. Without
> VHostMonsterResource, many other things will fail too; first you are
> likely to notice are redirects.
>
>
> To all nevow developers:
(Continue reading)

Matt Goodall | 2 May 2005 13:24

Nevow URL flattening (was Re: livepage)

Matt Goodall wrote:

>Tommi Virtanen wrote:
>
>  
>
>>Christopher Zorn wrote:
>>
>>    
>>
>>>>As I was the first to make this mistake, I'll answer : if you use Nevow
>>>>behing a
>>>>proxy (really, it's a proxy ? what did you mean by firewall ?), you
>>>>should look
>>>>after nevow.vhost.VHostMonsterResource.
>>>>        
>>>>
>>>Sorry, a reverse proxy. I have an apache reverse proxy to get to the
>>>server
>>>running the nevow livepage application. How will
>>>nevow.vhost.VHostMonsterResource
>>>fix this?
>>>The problem is, when I call render_liveglue it gives a tag similar to
>>><script src=http://server.behind.the.firewall.tld/nevow_glue.js />
>>>
>>>It needs to be the correct server or just nevow_glue.js in order to
>>>work correctly.
>>>      
>>>
>>Just wanted to confirm this quickly: you must use VHostMonsterResource,
(Continue reading)

gerardo arnaez | 3 May 2005 07:36
Picon

Context?

Hello all.

I have slowly been working my way through the nevow examples
I have start look at the base classes to understand what is going on,
but Im still stuck on what "context" is supposed to mean
in say (self, context,data)
I understand self, and understand data,
but dont understand the function or what the argument *context* is doing?

I have been going thought the examples and it is just not clear.

Any enlightening insight would be much appreciated
User Paolino | 3 May 2005 11:20
Picon
Favicon

Re: Context?

gerardo arnaez wrote:

>Hello all.
>
>I have slowly been working my way through the nevow examples
>I have start look at the base classes to understand what is going on,
>but Im still stuck on what "context" is supposed to mean
>in say (self, context,data)
>I understand self, and understand data,
>but dont understand the function or what the argument *context* is doing?
>
>I have been going thought the examples and it is just not clear.
>
>Any enlightening insight would be much appreciated
>
>  
>
#The context in which the rendering is happening.
#Apart from very useful information you can already get from it:

from nevow.inevow import IRequest
from nevow import rend

class Rendering(rend.Fragment):
  def  render_try(self,context,data):
     argumentsOfRquest=IRequest(context).args
     .....
#you can pass your own to it

from nevow import compy
(Continue reading)

Tommi Virtanen | 2 May 2005 19:52

Re: livepage

Matt Goodall wrote:
> I don't think is a good recommendation until rend.Page stops always
> handling an additional empty segment regardless of the value of
> addSlash. This behaviour has already been deprecated but not yet
> removed. See nevow.rend.Page.child_.
> 
> Right now, there's no way the developer can know if the URL the user
> used to reach the page is /foo or /foo/ and that makes it difficult to
> construct a correct relative URL.
> 
> I guess it's time to remove the deprecated child_ stuff.

Good point -- I try to be very careful about that in my own apps,
so I didn't even realize someone might write code that really does
not even know how it is used.
Matt Goodall | 3 May 2005 17:21

Re: livepage

Tommi Virtanen wrote:

> Matt Goodall wrote:
>
>> I don't think is a good recommendation until rend.Page stops always
>> handling an additional empty segment regardless of the value of
>> addSlash. This behaviour has already been deprecated but not yet
>> removed. See nevow.rend.Page.child_.
>>
>> Right now, there's no way the developer can know if the URL the user
>> used to reach the page is /foo or /foo/ and that makes it difficult to
>> construct a correct relative URL.
>>
>> I guess it's time to remove the deprecated child_ stuff.
>
>
> Good point -- I try to be very careful about that in my own apps,
> so I didn't even realize someone might write code that really does
> not even know how it is used. 

As those subscribed to the nevow commits list already know (sorry for
the spam ;-)), I started cleaning out much of the deprecated cruft in
Nevow last night. The above child_ behaviour is something that has now
been removed.

Right now, the changes are sitting in a branch but I'll merge to trunk
soon(ish).

Cheers, Matt

(Continue reading)


Gmane