#2033: tg2 not wsgi compliant with public/static content
-------------------------------------------------------------+--------------
Reporter: lszyba1 | Owner:
faide
Type: defect | Status:
new
Priority: highest | Milestone:
1.9.7b1
Component: TurboGears | Version:
trunk
Severity: critical | Resolution:
Keywords: needs feedback, wsgi, static files, deployment |
-------------------------------------------------------------+--------------
Comment (by lszyba1):
The basic problem is that when you deploy tg app under mod_Wsgi I deploy
apps not as root mounted app but under some name.
(root mounted) example.com/ vs (not root mounted) example.com/myapp/
The way you mount the non root app in apache configuration is this:
1. (you create an alias to the wsgi script in your apache settings)
2. the wsgi script that I'm aliasing has all the information it need to
load tg2 app
(example) WSGIScriptAlias /myapp /some/path/myapp.wsgi
Above should run my app example.com/myapp/
WSGIScriptAlias /myapp3 /some/path/myapp.wsgi
Would run my app example.com/myapp3/
When this happens a "SCRIPT_NAME" variable is passed to tg2 app(this is a
wsgi standard as I'm being told from wsgi list), in the example above the
script name I believe is "/myapp/". What this does is tells pylons app
that everything needs to be prefixed with "myapp" example.com/myapp/index
or example.com/myapp/adduser. The problem with this is that all url inside
the project are prefixed but the static files "images and css" are not
prefixed.
So while my app knows the url is example.com/myapp/index the static files
have no idea about the prefix and are pointing to example.com/images
instead of pointing to example.com/myapp/images
Due to wsgi
specifications(http://wsgi.org/wsgi/Specifications/routing_args) I should
be able to change the name of the prefix(SCRIPT_NAME) anyway I want and
all tg2 app and static content should be able to figure out the new url).
The only thing I should need to change is Alias variable.
WSGIScriptAlias /myapp3 /some/path/myapp.wsgi would display
example.com/myapp3/images
WSGIScriptAlias /myapp4 /some/path/myapp.wsgi would display
example.com/myapp4/images
I hope this clears things up.
It seems to me that "script_name" is already implemented withing tg2 but
its not implemented for static content.
--
Ticket URL: <http://trac.turbogears.org/ticket/2033#comment:2>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---