I have just launched my project into production. I have a functionality where the user can upload their own profile picture. People can upload their pictures, it is even stored in the correct directory. However, **when I try to achieve it I get a 404 not found error**. I am using Pythonanywhere and all pictures are stored at path: 

home/[username]/[project\_name]/media/profile\_picture

Here are the relevant code snippets:

**settings.py**

```
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

```

**urls.py**

```
urlpatterns = [
...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

```

**models.py**

```
class Person(models.model):
    ...
    profile_picture = models.ImageField(upload_to="profile_picture", blank=True, null=True)
    ...

```

**profile\_page.html**

```
...
    <div class="photo-container">
        {% if profile.profile_picture %}
            <img src="{{ profile.profile_picture.url }}">
        {% else %}
            <img src="{% static 'external_page/assets/img/placeholder.png' %}">
        {% endif %}
    </div>
...

```

When I isolate the tag:

```
{{ profile.profile_picture.url }}

```

I get:

/media/profile\_picture/[name\_of\_image\_file].jpg

**Update:**

I suspect that the error lies in the serving of the files and not in me referencing its path. I suspect that since I also get an 404 not found when 

I explicitly try to access the url of the media fiels (<https://www.website.com/media/profile_picture/[name_of_image_file.jpg]>), 

whilst I am able to access the respective static files. (<https://www.website.com/media/assets/[some_asset]>)

Although, that is the result of the python manage.py collectstatic