1

I am facing some very basic issue. I saved some detail in my django model including a profile picture. When i open django admin then i can saw i link for the image which i have saved.But when i click on that link it show me error.My image is not founding. How can i resolve the issue. settings.py

STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")

STATIC_URL = '/static/'
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "staticfiles"),
)

MEDIA_URL = '/media/'

MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media')

link showing me in django admin

media/media/ind_kQRDi6b.jpg

when i hit enter to open this this image it hit 127.0.0.1/8000/media/media/ind_kQRDi6b.jpg

And error show Page not found

C P Verma
  • 320
  • 7
  • 23
  • Possible duplicate of [Django. Media Files not found](http://stackoverflow.com/questions/39359104/django-media-files-not-found) – v1k45 Nov 13 '16 at 16:50
  • shouldn't that be 127.0.0.1/8000/media/ind_kQRDi6b.jpg – e4c5 Nov 14 '16 at 00:58

1 Answers1

1

Make sure that your url is correct. Like , http://127.0.0.1:8000/media/image.jpg