serving static files (was: How to create a project?)

martin f krafft madduck at
Tue Feb 2 17:03:38 EST 2010

also sprach Jeremy Kerr <jk at> [2010.02.02.1050 +1300]:
> > and there seems to be absolutely no CSS layout.
> You'll need to have configured your web server to handle the static files 
> itself. I have the following setup for
>         RewriteEngine On
>         RewriteCond %{REQUEST_URI} !^/(images|css|js|media)/.*
>         RewriteCond %{REQUEST_URI} !^/robots.txt
>         RewriteCond %{REQUEST_FILENAME} !-f
>         RewriteRule ^/(.*)$ /patchwork.fcgi/$1 [QSA,L]

Well, except the default sets up django.views.static.serve
for most of those, except media. However, since this is likely not
very performant, I use apache2 Aliases:

  Alias /images/ "/srv/patchwork/htdocs/images/"
  Alias /css/ "/srv/patchwork/htdocs/css/"
  Alias /js/ "/srv/patchwork/htdocs/js/"
  Alias /robots.txt "/srv/patchwork/htdocs/robots.txt"
  <Directory "/srv/patchwork/htdocs">
    Order allow,deny
    Allow from all

  Alias /media/ "/usr/share/python-support/python-django/django/contrib/admin/media/"
  <Directory "/usr/share/python-support/python-django/django/contrib/admin/media/">
    Order allow,deny
    Allow from all

The problem was that I had /admin/media there in the site I used to
bootstrap the WSGI configuration, probably to avoid namespace

Works now, thanks.

I sent an update to the patch in
<1264902001-30643-4-git-send-e-mail-madduck at> just now.

martin | |
"never try to explain computers to a layman.
 it's easier to explain sex to a virgin."
                                                    -- robert heinlein
(note, however, that virgins tend to know a lot about computers.)
spamtraps: madduck.bogus at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature (see
URL: <>

More information about the Patchwork mailing list