wwwuser
wwwuser

Reputation: 6362

django 1.4 local admin images 404

In Django 1.4, in my local development admin, when I upload an image for a model with an ImageField, the url to the uploaded file resolves to a 404.

My settings.py

MEDIA_ROOT = '%s/../public/media/' % os.path.dirname(__file__)
MEDIA_URL = 'http://mysite.dev:8000/media/'

Images in admin have a path of http://mysite.dev:8000/images/image.jpg

How do I show images uploaded in the local admin?

Upvotes: 1

Views: 467

Answers (1)

Emmanuel
Emmanuel

Reputation: 14209

Django is not meant to serve images, your HTTP server will (should, in production, anyway), hence the 404. BUT you can ask django to serve for your image in dev, as this other SO subject explains in details.

Upvotes: 0

Related Questions