Did you try a Google search? One of the top posts explains how to do
it for mod_python. As the method isn't really anything to do with the
hosting mechanism, but Django and static file serving with Apache, it
is just as applicable. See:
http://www.mysoftparade.com/blog/webalchemy-django-apache/
Also read up on Django flat pages app as it is sort of related. See:
http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
Graham
Gert, please stop confusing matters. If you don't know for absolute
certain, leave it to me to answer.
I possibly will not get a chance to properly answer these questions
until tomorrow. The answers to both are most covered in the
documentation. That is, there is documentation on how to host static
files in:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
There is documentation on issues that come up with using mod_python
and mod_wsgi together in:
http://code.google.com/p/modwsgi/wiki/InstallationIssues
I will say more later.
Graham
The short answer on WebAlchemy is that the way that WebAlchemy does
things is stupid. There is no need to go modifying the .htaccess file
to add special rewrite rules for each static overlay file.
Instead, in:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
in section 'The Apache Alias Directive' there is an example for using
resource base WSGI script file, but a single rewrite rule, with WSGI
script fixup, to make it appear at root of web server, or in place of
a directory for a sub URL scenario.
The rewrite rule for the root of site case is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /site.wsgi/$1 [QSA,PT,L]
What this rule says is that if a static file exists corresponding to
the URL, then serve up that static file. If no such file, then instead
route the request through the WSGI application.
Thus, all that something like WebAlchemy or FlatPages needs to do is
write out the preformatted response to a static file in the necessary
location within the document tree an it will be automatically served.
When the view needs to be invalidated, it removes the file, or could
also update it instead to refresh it. As such, elaborate rewrite rules
shouldn't be required unless the URL needing to be mapped cannot be
represented in normal directory hierarchy.
BTW, the above can also be adapted to case where fastcgi being used as
well. So, no need for silly .htaccess rewrites there either.
Graham
What I am saying is that how that blog explains to do it is a stupid
way of doing it. There are better ways of doing it. So, in some
respects I am saying now, you shouldn't follow the same steps as done
for mod_python.
What I very much suggest you do is to experiment with that
configuration I described on a simple test case, without using
WebAlchemy, and see how a static file can take precedence over one
served by WSGI application. Once you work out how that works, you
should be able to adapt how WebAlchemy was used to do it for
mod_python.
From memory, if you search back in the mailing list archives on Google
Groups, you you will some discussions about this static file overlay
technique previously.
Graham