Forums

Can I use Djangos authentication system to protect some of my static files?

I have static HTML (e.g., compiled Sphinx projects) and other static files, which should only be accessible to specific users. Is there a way to serve them as static files on pythonanywhere while using Django's authentication system to manage access?

Unfortunately not; Django is not involved at all when handling static files, which is what makes it faster and more efficient. You'll need to serve them up using normal Django views if you want access to them to be authenticated.