I block certain referers in my .htacccess file to avoid serving images to warez sites. The images are served directly so Django doesn’t touch them and I’d like to keep it that way because of performance.
But I would like to be able to add more blocked sites to the list inside the .htaccess file using the Django admin, without having to use FTP or SVN to access the site. Is this possible? How?
You could create a model that defines all the configurable part of .htaccess; then, add a signal (django doc) on each save, to call a function that will write a new .htaccess based on what has been defined on the database.
Something like this (as usual, this is untested code!):