I'm looking for a production wsgi server for Django and found aspen. I personally prefer an application server written in python with a reverse proxy out front, so aspen looks like a good fit for me.
Anyway couple comments regarding the Stephane installation instructions.
1) The symbolic links to from 2.4->2.x don't work on Windows. This took me awhile to figure out.
I have to admit I am bit confused by the way module path is handled by Django, so bare with me.
The tutorial shows to creation of a site with apps. I assumed in you example that www.example.com was the site and foo was the app.
When using Django's development server, the site is run from the site directory. In your case www.example.com.
This is where it gets interesting. Django then puts the site directory AND THE PARENT of the site directory into the module path when the development server is started.
This is confusing to me, but it means the django development server can be started from the site directory and modules can still be referenced as site.modulename.
To get aspen to work the same way, I added the following line to grapelli.py:
> I'm looking for a production wsgi server for Django and found > aspen. I personally prefer an application server written in > python with a reverse proxy out front, so aspen looks like a > good fit for me.
Thanks for giving Aspen a whirl. That's a perfect use-case for Aspen.
> Anyway couple comments regarding the Stephane installation > instructions.
Since releasing Stephane I've taken a different strategy by adding Django glue code directly to Aspen. Can I ask that you try out the development snapshot?
Actually, I'm doing tons of development right now using Django with an Aspen handler that I'm calling "scrimplates." This isn't documented yet, but here's the source:
Hope that gives you some pointers. Aspen really needs some lovin', but I've been swamped for the past couple months. Maybe we'll see an 0.8 release in July? /me crosses fingers
Thanks again for your interest and questions. I'm heading into the woods now but I'll check in on Monday.
To get the trunk version working the way I wanted, I did the following.
Created apps.conf which allows me to serve files from /static and django everywhere else.
/ apps.django_:wsgi /static apps.static:static
Created aspen.conf:
[main] address = :8000
[django] settings_module = sitename.settings
aspen is run from the django site root directory, hence aspen root directory = django site root directory. This is same as using django's manage.py runserver
Applied the following changes.
The first changes adds '..' to the path just as manage.py runserver does in Django
The second change fixes a bug with miss named object
> What is the difference between an app and a handler?
Simple: apps are tied to directories, handlers to files.
> Which do you recommend that I use?
If you're satisfied with Django's URL routing then stick with an app mounted at the root (/). If you find Django's URL routing to be cumbersome, then check out the Aspen's Django handlers.
I know this isn't how you intend to use aspen, but it most closely models the structure of the manage.py runserver django command.
To me it feels odd to put my application code in the magic __ directory. I could see putting third party libs there, but I want my application code in site's root directory.
That's helpful, thanks. And you also have a __ dir under www.example.com, with etc/{aspen,apps}.conf?
> I know this isn't how you intend to use aspen, but it most closely > models the structure of the manage.py runserver django command.
> To me it feels odd to put my application code in the magic __ > directory. I could see putting third party libs there, but I want my > application code in site's root directory.
I love that you just tweaked Aspen to do what you want. That's part of the power of a pure-Python server. We've danced around this filesystem layout question before, and I expect to address the issue more fully when I have some good chunks of time. In the meantime workarounds of the sort you found are the best bet.
Thanks for your experimentation and let us know what other issues or successes you meet with.