right now i'm considering using __/etc/apps to point to a selector
wsgi, but that seems like an extra bit of work..
Thanks for the input!
> any chance for a __/etc/selector configuration file to permit
> instantiating selector?
I assume that __/etc/selector.conf would be in the "text file
format for expressing mappings" added in selector 0.8, yes? This
is a perfect usage of the __/etc directory!
However, while Luke's stuff looks great, I'm reluctant to let it
get too close to Aspen because it's GPL.
> right now i'm considering using __/etc/apps to point to a selector
> wsgi, but that seems like an extra bit of work..
Yeah, the thing to do is to build a little shim, to be wired up
in apps.conf or maybe even middleware.conf. See Stephane for an
example of such a shim (for Django):
http://code.google.com/p/aspen-commons/wiki/Stephane
I've taken the liberty of adding you as a member of the Aspen
Commons project: if so inspired, go ahead and develop
aspen_selector (call it what you like) in there. It will probably
look something like this:
__/lib/python2.x/aspen_selector.py
==================================
from os.path import join
import aspen
import selector
selector_conf = join(aspen.paths.__, 'etc', 'selector.conf')
wsgi = Selector(mapfile=selector_conf)
__/etc/apps.conf
================
/ aspen_selector:wsgi
You're right that this is "an extra bit of work," but we have to
draw the line somewhere between Aspen and our websites, no?. :)
Thanks again for jumping in!
chad
> i've actually decided not to use selector because i have so many modules
> that I'd rather dynamically import (to prevent importing fifteen
> million modules for every request) so i'll just examine the path and
> import the module based on the path.
You should be able to import them all at start-up, no? Maybe I
don't understand selector well enough ...
> ah, good point... maybe he'd consider dual-licensing for this purpose.
I'm particularly interested in his static app. I guess it doesn't
hurt to ask, right?
> thanks for such an awesome webserver! simple, clean, pure, no
> dependencies, very nice and clean!
Thanks for the kind words! I hope Aspen continues to prove
valuable to you, enough to elicit some bug reports and patches. :-D
> btw, maybe you could throw the stuff in your vidcast on PHP
> (fastcgi_app) and your modded version into the howto. That's very
> interesting stuff!! :-)
Good suggestion. The tutorial got a little thin when I removed
some dynamic bits from the default setup (for security sanity),
but I agree that it should be filled out more with some other
recipes.
chad