开发者

Problem with ImageField and Admin Panel

I know, this topic was there many time, but there is no clear answer开发者_如何学Go:

invalid literal for int() with base 10

I use django. I just want to see pictures, which I've uploaded, by admin panel. In my model it's just ImageField. Nothing sophisticated.


What is the URL that the image links point to? That should give you a good idea about what is causing the problem.

Make sure to set your MEDIA_URL and that it has a trailing /

I'm guessing the the admin is pointing to a relative url. Say... /admin/myapp/mymodel/3/images/my-image.png

It's a common error with the django admin because the admin site is expecting a primary key.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜