FastCGI front-end to Django

View: New views
2 Messages — Rating Filter:   Alert me  

FastCGI front-end to Django

by Tim Lavoie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I thought I'd try out Ozgur's wiki recipe for using Yaws as a FastCGI
front-end for Django, and I already have a Django site running this way
behind Apache.

I have run into an odd-looking issue though. While I get a page back
nice and quick, it's always the *same* page. Where I have one page at /
and another at /foo/, the latter always returns the same data as the
former. I don't get any errors, but it's like Django isn't getting the
rest of the path. The same requests on another port to the Apache
instance work as I'd expect. Any ideas?

  Tim

--
"There's no trick to being a humorist when you have the whole
government working for you."
    --Will Rogers

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list

Parent Message unknown Re: FastCGI front-end to Django

by Tim Lavoie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, I found the source of my problem. Django looks for a SCRIPT_URL
parameter, which Apache will set if mod_rewrite is being used. While
not really a YAWS issue, I was receiving the front (default) page for
every request. Django takes a settings parameter (FORCE_SCRIPT_NAME = '')
which fixes this when using YAWS in front.

I haven't added this to the wiki entry at
http://wiki.github.com/klacke/yaws/run-django-under-yaws, perhaps
someone with an ID on github could do so.

In any case, my digging into the FastCGI protocol, packets and various
source code was most enlightening.  <grin>

  Cheers,
  Tim

--
I have an existential map.  It has "You are here" written all over it.
                -- Steven Wright

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list