2

pythonanywhere cant find files in me media folder enter image description here

But I have this file! enter image description here

roots in my settings.py

STATIC_URL = '/static/'

STATIC_ROOT = '/home/dimabytes/my-first-blog/static'

MEDIA_ROOT = '/home/dimabytes/my-first-blog/media'
MEDIA_URL = '/media/'

me web page at pythonanywhere

enter image description here

2 Answers 2

3

The problem was that I automatically displayed the working directory in the folder with my name. It was necessary to finish the path of the project введите сюда описание изображения

2
  • Hello, I cannot understand the difference between first and this pythonanywhere screen. What did you change? "It was necessary to finish the path of the project" do you mean you added "/" to the end of the static and media dir's on the pic? Commented Mar 5, 2020 at 12:52
  • Oh, I think yes. Share your email, and I will try to help you with it
    – Dimabytes
    Commented Mar 8, 2020 at 21:48
0

It's because you have your path configured incorrectly, either when you call for the media or your MEDIA_ROOT and MEDIA_URL, most likely the former. If you look at your pythonanywhere file storage and your error output, it's looking for the file in media/static/<file_here>. Your targeted file is in /media/file/<file_here>.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.