File upload directory issue


I've got a model with an ImageField:

photo = models.ImageField(upload_to="static/home/images/", null=True, blank=True, validators=[file_size])

And to show that image in the template, I use:

<img src="/{{ }}" class="img-responsive" style="max-width: 980px;">

Which works fine on my computer, and the images uploaded before (model instances created on my local computer) are shown on PythonAnywhere without issue.

However, when I use the same code on PythonAnywhere, image is not uploaded to the correct directory and not shown. Instead of


it is uploaded to


(My user and project name are both "steerr"). So I changed my model as:


Now the files are uploaded to the correct folder. But they are still not displaying on html because

{{ }}

is now


...with non-existent URL

Whereas it's expected to be


...with the correct URL

It's a bit confusing, sorry.

Any suggestion or feedback will be welcomed and greatly appreciated.


try changing your working directory for your webapp. (under configs in your webapps tab)

It worked, thank you!