Sponsored by: | 2degrees Limited. |
---|---|
Latest release: | 1.0 |
The admin_media recipe loads the absolute path to the media files in Django Admin into a Buildout part, so you can refer to this path from other recipes (i.e., in order to let the Web server serve those static files).
This recipe doesn’t take any option, so you can just use the following:
[buildout]
parts = django_admin
[django_admin]
recipe = djangout:admin_media
And the path to this directory will be available from any part/recipe as ${django_admin:admin_media_root}.
You can use this variable to generate an Apache virtual host configuration from a template like the one below:
<VirtualHost 127.0.0.1:80>
# ...
Alias /admin_media ${django_admin:admin_media_root}
<Directory ${django_admin:admin_media_root}>
Order deny,allow
Allow from all
</Directory>
# ...
</VirtualHost>