On 28/01/2008, Lukasz Szybalski <[EMAIL PROTECTED]> wrote:
> > I don't know how TurboGears itself is implemented and copes with
> > changes to code.
> >
> > One thing to watch out for are old .pyc files laying around. If for
> > some reason these exist but where they contain compiled byte code for
> > older version of code file, it could be running it. So, start by
> > removing .pyc files in your application directories.
> >
> I have removed pyc already.
>
> Actually there is a weird property with paths.
>
> First: if I set in apache:
>
> WSGIScriptAlias /myfirstapp
> /usr/local/turbogears/myfirstapp/apache/myfirstapp.wsgi
>
> 1. Instead of index I have myfirstapp page.
> That apache config is all I need to access my
> example.com/myfirstapp/myfirstapp
> ---domain-------apache-----myapp
>
>  (no need for webpath) myfistapp page is working properly.
> a)example.com/myfirstapp/myfirstapp accesses my form (good)
> example/com/myfirstapp/ gives me a 404 (good)
> b)BUT now If click 'save' button it redirects me to
> example.com/savemyfirstapp since it doesn't know about baser url!
> (Shouldn't WSGIScriptAlias /myfirstapp step in here and redirect all
> requests to /myfirstapp/xxxxx? Why yes or why not?)

The mod_wsgi package does the correct thing, if anything it is because
TurboGears isn't a WSGI compliant application. TG should if mounted at
a sub URL ensure it does trailing slash redirection for the top of the
TG application. Possibly you must use webpath configuration for that,
or my fiddle to try and get TG to behave properly when mounted at a
sub URL when running under WSGI isn't enough to make TG work properly.

> Weird: I can also access:
> example.com/myfirstapp/myfirstapp
> example.com/myfirstapp/myfirstapp/myfirstapp
> example.com/myfirstapp/myfirstapp/myfirstapp/myfirstapp

That I can't comment on. Sounds like a problem with your TG URL
mapping configuration, or see below.

> 2. Since my save didn't work, this means that my turbogears app needs
> to know the base url (server.webpath).
> ok. I add this to my myfirstapp.wsgi config file:
> turbogears.config.update({'global': {'server.webpath': '/myfirstapp'}})
>
> weird:
> now my first page doesn't work:
> a)example.com/myfirstapp/myfirstapp (doesn't work)
> b)but example.com/myfirstapp/myfirstapp/myfirstapp page works.???
> -----domain-----------apache-----wsgi-------my-apps-page
> c)my save works properly (good).
>
> This means that webpath is needed internally to get all links working.
> But what about my entry point. It seems as it the entry url now is
> duplicated with apache and webpath.
> example.com/myfirstapp/myfirstapp/myfirstapp
> -----domain-------apache-----wsgi-------my-apps-page
>
> This is a problem now because I cannot remove apache alias(because I
> don't want / mounted app) I cannot remove my wsgi webpath(because my
> links won't work) and I definitely can't remove my apps page(since
> that is the main reason for the app).
>
>
> So, what is going on here? Why apache WSGIScriptAlias+ webpath
> represent (/myfirstapp/myfirstapp) and not (/myfirstapp)?
> Aren't they talking about same path?
>
> If I am setting something incorrectly please let me know what the
> proper configuration should be?!

People on TG list will need to help you out with this.

>From what I can tell you have called a sub application of your site
the same name as the site. This to me would seem to be a very bad idea
because depending on how the Python module search path is defined all
sorts of weird things could happen.

This may actually be the cause of all your problems, so don't call
your sub application the same name as your site, call it something
different and start over again.

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to