How would I only allow users authenticated via Python code to access certain files on the server?
For instance, say I have /static/book.txt
which I want to protect. When a user accesses /some/path/that/validates/him
, a Python script deems him worthy of accessing /static/book.txt
and redirects him to that path.
How would I stop users who bypass the script and directly access /static/book.txt
?