django suspicious operation on image upload

后端 未结 1 840
广开言路
广开言路 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)
提交回复
热议问题