durusmail: quixote-users: Introducing myself, a small bug and RPMs for Quixote
Introducing myself, a small bug and RPMs for Quixote
2001-11-12
2001-11-12
2001-11-13
Seeking a Small Example of Forms/Widget Usage
2001-11-13
2001-11-13
2001-11-22
2001-11-22
2001-11-22
2001-11-23
Re: Seeking a Small Example of Forms/Widget Usage
2001-11-26
2001-11-26
2001-11-27
Mystery re ZODB Technique in vfab
2001-11-28
2001-11-28
An Example of Quixote/ZODB/Grouch Usage
2001-11-29
2001-11-13
Grouch and ZODB
2001-11-20
2001-11-21
2001-11-21
2001-11-21
2001-11-21
Introducing myself, a small bug and RPMs for Quixote
Greg Ward
2001-11-21
On 20 November 2001, Jeff Rush said:
> With Quixote targeting near Zope, I'm surprised you're not well-versed
> in Zope and therein the frustration that led to the creation of Quixote.
> Know that which you're trying to improve on and all... ;-)

Lucky Neil, he came along *after* we tried Zope, dumped Zope, and Andrew
started writing Quixote.

> Anyway, I mispoke.  The 'magic' item that Zope inserts automatically is:
>
>       
>
> to tell the browser the base URL to which relative URLs apply.
[...]
> Fitting into the no-magic principle of Quixote, I guess each designer
> will need to add it to their standard_html_header.ptl.

Bingo.  NO MAGIC.

> I'm just surprised no one has missed it so far.

I'm not.  I've never used it, never knew Zope put it in my web pages,
never relied on it, and have to admit I don't completely understand it
(because I've never used it).  I would bet a fair chunk of web
programmers are in the same boat as I am.  If you need or want , add it yourself!

> I think there is a bug here someplace.  The http_request.get_path()
> constructs the path from:
>     path = "%(SCRIPT_NAME)s%(PATH_INFO)s" % self.environ
>
> but, via request.dump(), I see a SCRIPT_NAME of "/q/" and a PATH_INFO
> of "", making a path of "/q/".  The URL I invoked was:
>
>     http://vault.timecastle.net/cgi-bin/windmill/
>
> where windmill is the CGI that invokes Quixote.  I have no idea where
> the "/q/" came from.  Is that Quixote's shortname for "_q_index"?

"/q/" comes from the URL_PREFIX config variable.  The last thing
Publisher.traverse_url() does before returning the callable object that
results from URL-traversal is:

    script_name = "/".join([self.config.url_prefix] + path_components)
    request.environ['SCRIPT_NAME'] = script_name
    request.environ['PATH_INFO'] = '' # we always traverse the entire path

...so once the request is in your hands, the environment is no longer
identical to what Apache gives to Quixote.  I'm pretty sure this is a
feature.  ;-)

> I expected get_path() to return basically REQUEST_URI:
>
>     /cgi-bin/windmill/

Then you should set URL_PREFIX to "/cgi-bin/windmill/", since that is
the prefix for your app (at least until you set up the rewrite trickery
explained in doc/web-server.txt).  This is essential for internal
redirects within your app to work, too.

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply