I am a new comer to both Django and Cappuccino. I've got a Django site setup and running through Apache via mod_wsgi. I wish to use Django because the after sales for any Cappuccino application, but a VirtualHost setup in Apache and mod_wsgi for everyone a Django application serves static files from another location compared to normal web root (e.g. http://example.com/media/ or http://media.example.com).

How could I setup the atmosphere to ensure that http://example.com serves my Cappuccino Javascript/HTML/CSS files, whilst letting me make use of the typical Django URL system to produce endpoints for AJAX calls (e.g. http://example.com/some/json/)?

Perhaps you have read:


It goes into various facets of using WSGIScriptAlias for mod_wsgi and Alias directives for static files.

I'd suggest you be sure that your read that, or reread it, after which publish what configuration you've attempted already as that can help explain what you're attempting to do and may then just correct it.

This is actually the configuration I emerged with this works:

Django Media Configurations:

MEDIA_ROOT = '/Users/Me/Development/Web Projects/mysite/mysite/public_html'
MEDIA_URL = 'http:/mysite.local/'

Apache VirtualHost Configuration:

<VirtualHost *:80>
    ServerAdmin webmaster@mysite.local
    ServerName mysite.local
    ErrorLog "/private/var/log/apache2/mysite.local-error_log"
    CustomLog "/private/var/log/apache2/mysite.local-access_log" common
    WSGIScriptAlias / "/Users/Me/Development/Web Projects/MySite/django.wsgi"
    <Directory "/Users/Me/Development/Web Projects/MySite/">
    	Allow from all
    AliasMatch ^/(.*\.[A-Za-z0-9]{1,5})$ "/Users/Me/Development/Web Projects/MySite/public_html/$1"
    <Directory "/Users/Me/Development/Web Projects/MySite/public_html">
    	Order deny,allow
    	Allow from all

Essentially this setup assists any request having a file extension (I limited mine for an extension of 5 figures or less) like a static file, and all sorts of other demands goes to my Django application.