How does Django restrict access to pictures?

problem description

when Django is deployed, static resources are public. You can directly copy the url corresponding to the image to the browser address bar to access the image. Now if you want to add restrictions to prevent this operation, you must pass some kind of authentication before accessing the image. Do you have any good ideas?

Nov.24,2021

copy the URL address to view the picture, which can definitely be done, otherwise how can your resource browser get it? I guess you are afraid of others traversing your static resources. You can replace the static resource ID with a random number (such as uuid)


plus middleware to verify the referer of the request header for requesting picture resources, but this thing protects against gentlemen but not villains.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ae5-2c0a7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ae5-2c0a7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?