django suspicious operation on image upload

后端 未结 1 834
广开言路
广开言路 2021-01-23 23:50

In my admin I try to upload an image and after clicking save I get this error:

SuspiciousOperation at /admin/the_chooser/book/add/
Attempted access to \'/media/5         


        
相关标签:
1条回答
  • 2021-01-24 00:12

    Remove the first slash in your upload_to path so that it reads: upload_to='media/'

    0 讨论(0)
提交回复
热议问题