base_url config option don`t use base path or hardcoded redirects

6 views
Skip to first unread message

Safronovich Victor

unread,
Mar 11, 2008, 2:20:16 AM3/11/08
to post...@googlegroups.com
hello, posterity groop.

I`m using posterity 0.6, apache 2.2.8 + mod_wsgi 2.0c4 as front-end
server on local machine.

My configs are:

apache posterity.conf
-----
WSGIScriptAlias /posterity "C:/instances/posterity/apache/posterity.wsgi"
<Directory "C:/instances/posterity/apache/">
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from 127.0.0.1
</Directory>
-----

posterity.wsgi
-----
import sys
sys.stdout = sys.stderr
import os

inst = os.environ['POSTERITY_INSTANCE'] = 'C:/instances/posterity'

from posterity.core import make_posterity_app

application = make_posterity_app({}, instance=inst)
-----

When i get the url http://localhost:8080/posterity, browser redirected to
http://localhost:8080/login, which is wrong. Right url is
http://localhost:8080/posterity/login.
When i manually get the url http://localhost:8080/posterity/login,
server returns right login page, and when i fill login and pass,
browser redirected to wrong http://localhost:8080/tags/Inbox/convs.
Right url is http://localhost:8080/posterity/tags/Inbox/convs.

When i added to config new option base_url =
http://localhost:8080/posterity, nothing are changed, because
PatchEnvironMiddleware don`t handle base path.

When i changed wsgi alias to url '/', everything works fine.

And more. Trac, which uses the same mod_wsgi on base url /trac
(WSGIScriptAlias /trac "C:/instances/trac/apache/trac.wsgi")
works fine.

Please, help me to run posterity with base path "/posterity".
Sorry for my english, have a nice day.

--
Regards,
Safronovich Victor

Jonas Borgström

unread,
Mar 11, 2008, 3:28:02 PM3/11/08
to post...@googlegroups.com
Safronovich Victor wrote:
> When i get the url http://localhost:8080/posterity, browser redirected to
> http://localhost:8080/login, which is wrong. Right url is
> http://localhost:8080/posterity/login.
> When i manually get the url http://localhost:8080/posterity/login,
> server returns right login page, and when i fill login and pass,
> browser redirected to wrong http://localhost:8080/tags/Inbox/convs.
> Right url is http://localhost:8080/posterity/tags/Inbox/convs.
>
> When i added to config new option base_url =
> http://localhost:8080/posterity, nothing are changed, because
> PatchEnvironMiddleware don`t handle base path.
>
> When i changed wsgi alias to url '/', everything works fine.
>
> And more. Trac, which uses the same mod_wsgi on base url /trac
> (WSGIScriptAlias /trac "C:/instances/trac/apache/trac.wsgi")
> works fine.
>
> Please, help me to run posterity with base path "/posterity".
> Sorry for my english, have a nice day.

Hi Victor,

You're absolutely correct, most link urls are currently hard coded in
the templates. This is not an optimal solution and causes problems like
the one you described above. This was originally intended to be a
temporary solution until I figured out the best way to generate links
properly. Unfortunately this has taken longer than expected but I will
try to fix this as soon as possible.

I've created a new ticket for this issue:

http://posterity.edgewall.org/ticket/49

Thanks for the report!

/ Jonas

Reply all
Reply to author
Forward
0 new messages