2009/8/17 vishnu <[email protected]>: > > On Aug 16, 10:13 am, Graham Dumpleton <[email protected]> > wrote: >> 2009/8/14 Graham Dumpleton <[email protected]>: >> >> >> >> > 2009/8/14 gert <[email protected]>: >> >> >> On Aug 14, 9:39 am, vishnu <[email protected]> wrote: >> >>> On Aug 14, 12:27 pm, vishnu <[email protected]> wrote: >> >> >>> > hi Graham, >> >> >>> > The doc first doc u showed mentions of using mod_python with apache2. >> >>> > How or what differs when we use the mod_wsgi was what i wanted to >> >>> > know? >> >> >>> > Thanks >> >>> > Vishnu >> >> >>> > On Aug 12, 3:51 pm, Graham Dumpleton <[email protected]> >> >>> > wrote: >> >> >>> > > 2009/8/12 vishnu.kumar <[email protected]>: >> >> >>> > > > Hi, >> >> >>> > > > Is it possible to use webalchemy in a mod_wsgi to accelerate django >> >>> > > > apps? >> >>> > > > If it is a yes, then where can i find docs for achieving the same? >> >> >>> > > 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 >> >> >>> Also, >> >>> is it possible to have a dual setup of both mod_wsgi and mod_python >> >>> with webalchemy? >> >>> Would it be safe? >> >> >> If I am not mistaken >> >> -Possible: yes using daemon mode >> >> -Safe: no c level malfunctions >> >> -Recommendation: defenatly not :) >> >> > 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. >> >> 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 > > Thanks for the reply Graham. > > I will have a look at it. > > So, does that mean that we have to follow the same steps for modwsgi > as modpython?
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" 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/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
