Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save timonweb/4051605 to your computer and use it in GitHub Desktop.
Save timonweb/4051605 to your computer and use it in GitHub Desktop.
Serving static files for Django on Webfaction
# put after other LoadModule lines
LoadModule alias_module modules/mod_alias.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule expires_module modules/mod_expires.so
...
<VirtualHost *:<webapp-port>>
...
# after WSGIScriptAlias
Alias /media /home/<username>/webapps/<wsgi-app>/<virtualenv-dor>/media/
<Directory /home/<username>/webapps/<wsgi-app>/<virtualenv-dor>/media>
Order allow,deny
Allow from all
ExpiresActive On
ExpiresDefault "modification plus 12 hours"
</Directory>
...
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment