# media files not found on pythonanywhere

**URL:** <https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255>\
**Category:** Deployment\
**Created:** [May 30, 2023, 9:15pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255 "2023-05-30T21:15:57Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [May 30, 2023, 9:15pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/1 "2023-05-30T21:15:57Z")

</div>

The site is connected fine but images are not showing. i have done python3.8 manage.py collectstatic. Below are my setting on pythonanywhere.

```
  #### Code:
  
  What your site is running.
  
  Source code:
  
  [/home/Wilfred7/Django_market_place](https://www.pythonanywhere.com/user/Wilfred7/webapps/#)
  
  [Go to directory](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place)
  
  Working directory:
  
  [/home/Wilfred7/Django_market_place](https://www.pythonanywhere.com/user/Wilfred7/webapps/#)
  
  [Go to directory](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place)
  
  WSGI configuration file:
  
  [/var/www/wilfred7_pythonanywhere_com_wsgi.py](https://www.pythonanywhere.com/user/Wilfred7/files/var/www/wilfred7_pythonanywhere_com_wsgi.py?edit)
  
  Python version:
  
  3.8

```

#### Static files:

Files that aren’t dynamically generated by your code, like CSS, JavaScript or uploaded files, can be served much faster straight off the disk if you specify them here. You need to **Reload your web app** to activate any changes you make to the mappings below.

| URL | Directory | Delete |
| --- | --- | --- |
| [/static/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | [/home/Wilfred7/Django\_market\_place/jijiapp/static](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | |
| [/media/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | [/home/Wilfred7/Django\_market\_place/media/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | |
| [/logos/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | [/home/Wilfred7/Django\_market\_place/logos/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | |
| [/thumbnails/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | [/home/Wilfred7/Django\_market\_place/thumbnails/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | |
| [Enter URL](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | [Enter path](https://www.pythonanywhere.com/user/Wilfred7/webapps/#) | |

this is the directory

| [.cache/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.cache) | |
| --- | --- |
| [.local/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.local) | |
| [.virtualenvs/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.virtualenvs) | |
| [Django\_market\_place/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place) | |

#### Files

| [.bashrc](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.bashrc?edit) | | | | 2023-05-25 20:33 | 560 bytes |
| --- | --- | --- | --- | --- | --- |
| [.gitconfig](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.gitconfig?edit) | | | | 2023-05-29 20:14 | 332 bytes |
| [.my.cnf](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.my.cnf?edit) | | | | 2023-05-28 19:08 | 37 bytes |
| [.profile](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.profile?edit) | | | | 2023-05-25 20:33 | 79 bytes |
| [.pythonstartup.py](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.pythonstartup.py?edit) | | | | 2023-05-25 20:33 | 77 bytes |
| [.sqlite\_history](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.sqlite_history?edit) | | | | 2023-05-29 18:21 | 598 bytes |
| [.vimrc](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/.vimrc?edit) | | | | 2023-05-25 20:33 | 4.6 KB |
| [README.txt](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/README.txt?edit) | | | | 2023-05-25 20:33 | 232 bytes |
| [Wilfred7$SQLite](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Wilfred7%24SQLite?edit) | | | | 2023-05-28 21:13 | 0 bytes |
| | | | | | |

[/](https://www.pythonanywhere.com/user/Wilfred7/files/)[home](https://www.pythonanywhere.com/user/Wilfred7/files/home)/[Wilfred7](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7)/Django\_market\_place

#### Directories

| [.git/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/.git) | |
| --- | --- |
| [HomeImage/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/HomeImage) | |
| [jijiapp/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/jijiapp) | |
| [jijiclone/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/jijiclone) | |
| [jijistore/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/jijistore) | |
| [logos/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/logos) | |
| [media/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/media) | |
| [staticfiles/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/staticfiles) | |
| [thumbnails/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/thumbnails) | |
| [venv/](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/venv) | |

#### Files

| Wilfred7$SQLite | | | | 2023-05-28 21:51 | 340.0 KB |
| --- | --- | --- | --- | --- | --- |
| db.sqlite3 | | | | 2023-05-30 20:20 | 340.0 KB |
| [manage.py](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/manage.py?edit) | | | | 2023-05-25 20:35 | 665 bytes |
| [requirements.txt](https://www.pythonanywhere.com/user/Wilfred7/files/home/Wilfred7/Django_market_place/requirements.txt?edit) | | | | 2023-05-25 20:35 | 111 bytes |
| | | | | | |

the media, logos, thumbnails all are not showing

STATIC\_URL = ‘/static/’  
STATICFILES = [os.path.join(BASE\_DIR, ‘static/’)]  
STATIC\_ROOT =os.path.join(BASE\_DIR, ‘staticfiles’)  
MEDIA\_URL =‘media/’  
STATIC\_ROOT = “/home/Wilfred7/Django\_market\_place/jijiapp/static”

```
2023-05-30 20:45:54,091: Not Found: /media/media/fan1_G0la2zj.jfif
2023-05-30 20:45:54,115: Not Found: /media/thumbnails/fan2_uBdhCUA.jfif
2023-05-30 20:45:54,134: Not Found: /media/thumbnails/ecco_n7ZKjaI.jpg
2023-05-30 20:45:54,146: Not Found: /media/thumbnails/tv1.jfif
2023-05-30 20:45:54,195: Not Found: /media/thumbnails/bag2_yKX0aGx.jfif
2023-05-30 20:45:54,343: Not Found: /media/thumbnails/bag4.jfif
2023-05-30 20:45:54,346: Not Found: /media/thumbnails/florer_kazITRQ.jpg
2023-05-30 20:45:54,710: Not Found: /media/thumbnails/super.jfif

```

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [May 31, 2023, 5:19pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/2 "2023-05-31T17:19:04Z")

</div>

Please i need help here

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [May 31, 2023, 7:04pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/3 "2023-05-31T19:04:49Z")

</div>

> [@Wilfred1213](#):
>
> MEDIA\_URL =‘media/’  
> STATIC\_ROOT = “/home/Wilfred7/Django\_market\_place/jijiapp/static”

I think you miss to pass the media\_root path in your settings.py file as you did with static file  
review your settings.py file.  
You need to adjust the path on settings.py file as on the pythonanywhere server

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [May 31, 2023, 7:35pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/4 "2023-05-31T19:35:14Z")

</div>

you mean like this

```
                  MEDIA_ROOT ='/home/Wilfred7/Django_market_place/media'
                  MEDIA_URL = '/media/'

```

i try this but it refuses

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [May 31, 2023, 7:42pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/5 "2023-05-31T19:42:15Z")

</div>

Please take a look at this

- [Media files not found](https://www.pythonanywhere.com/forums/topic/28483/)

I think it’s helpful

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [May 31, 2023, 7:58pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/6 "2023-05-31T19:58:57Z")

</div>

I went through it patiently but it doesnt work in my case. just cant figure out the problem for over a week now

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 1, 2023, 8:13am UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/7 "2023-06-01T08:13:14Z")

</div>

Okay let me check on one of my demo app on pythonanywhere , Because I didn’t upload image on it

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 1, 2023, 12:11pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/8 "2023-06-01T12:11:50Z")

</div>

It’s working properly on my site as I said to you before you have something error in your media path

Let’s review your configuration for this.

- First of all you must be sure that your local code can generate (`media`) folder automatically with the uploaded image in order to continue the next steps.

- make `DEBUG="True"` in your (`.env`) file on pythonanywhere server (don’t forget to reload the server from WEB tab to activate your action)

- Be sure that the next lines are exists on your local settings.py file

```auto
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media")
MEDIA_URL = "/media/"

```

NOT as yours

> [@Wilfred1213](#):
>
> `MEDIA_ROOT ='/home/Wilfred7/Django_market_place/media'`

- Be sure that the next lines are exists on your local main urls.py file

```auto
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

```

- On pythonanywhere server you must write the path as you mention above

> [@Wilfred1213](#):
>
> |[/media/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#)|[/home/Wilfred7/Django\_market\_place/media/](https://www.pythonanywhere.com/user/Wilfred7/webapps/#)|

But without an ending slash as  
`/media/|/home/Wilfred7/Django_market_place/media`

- Be sure of your paths carefully on [pythonanywhere.com](http://pythonanywhere.com) server when you write paths
- If the media folder created automatically for you on pythonanywhere server then you are in the right direction and you are succeeding to upload your images (To ensure of that)  
`https://your_app_name.pythonanywhere.com/media/path/to/image.png`
- Check your image on your website it will appear after refresh the page
- Don’t forget to reload the sever every time you change anything on [pythonanywhere.com](http://pythonanywhere.com) server from web tab.

We are finishing now

Good Luck

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [June 1, 2023, 7:49pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/9 "2023-06-01T19:49:01Z")

</div>

Thank you for your effort. I have tried as you describe. But up to now the image is not showing. Below is the way i updated my url and setting as you pointed out

```
    DEBUG = True

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

  urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('jijiapp.urls')),
      path('store/', include('jijistore.urls')),
      path('login/', auth_views.LoginView.as_view(template_name='jijiapp/registration/login.html', authentication_form=LoginForm), name='login'),
      # path('accounts/', include('django.contrib.auth.urls')),
      # path('inbox/', include('jijiapp.routing')),
  
      path('accounts/password_reset/', auth_views.PasswordResetView.as_view(
          template_name='jijiapp/registration/password_reset.html'), name='password_reset'),
      path('accounts/password_reset/done/', auth_views.PasswordResetDoneView.as_view(
          template_name='jijiapp/registration/password_reset_done.html'), name='password_reset_done'),
      path('accounts/reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(
          template_name='jijiapp/registration/password_reset_confirm.html'), name='password_reset_confirm'),
      path('accounts/reset/done/', auth_views.PasswordResetCompleteView.as_view(
          template_name='jijiapp/registration/password_reset_complete.html'), name='password_reset_complete'),
  
  ]
  urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

```

The static files

```
|URL|Directory|Delete|
|---|---|---|
|/static/|/home/Wilfred7/Django_market_place/jijiapp/static| |
|/media/|/home/Wilfred7/Django_market_place/media| |
|/logos/|/home/Wilfred7/Django_market_place/logos| |
|/thumbnails/|/home/Wilfred7/Django_market_place/thumbnails| |
|Enter URL|Enter path||

```

i have carefully looked ate the directory to see if i make any mistake but i could not trace any mistake. I have refresh the web. it still did not show up.

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 1, 2023, 8:16pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/10 "2023-06-01T20:16:43Z")

</div>

Okay

- Have you checked if your local generates media folder automatically ?

- Have your static files work as expected on pythonanywhere ? (try to check by)

```auto
https://your_app_name.pythonanywhere.com/static/path_to_any_file_in_your_static

```

- Have the media folder generated on the pythonanywhere server ? (if yes check by)  
`https://your_app_name.pythonanywhere.com/media/path/to/image.png`  
(If No) we still have the problem.

- Can you share your local settings.py (**Copy and paste between (```)** to investigate it clearly)?

- Can you share your local urls.py as settings.py

- Can you share web tab settings on the server ( **Only take a screen shot** ) ?

- Also I need to see the code responsible for upload the image in your local site

- Share with us the link to your `your_app.pythonanywhere.com` link

I hope to fix this issue, you maybe miss something

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [June 1, 2023, 9:03pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/11 "2023-06-01T21:03:54Z")

</div>

Yes, i dont know if you will need the address of the entire project on on github [Wilfred1213/Django\_market\_place: A website that allows people to sell and buy (github.com)](https://github.com/Wilfred1213/Django_market_place)

this is address to the project [Jiji Clone (wilfred7.pythonanywhere.com)](http://wilfred7.pythonanywhere.com/)

this is my setting.py on my local system not on python anywhere as you requested

```
  import os
  from pathlib import Path
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path( __file__ ).resolve().parent.parent
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = []
  
  
  LOGIN_URL = '/login/'
  LOGIN_REDIRECT_URL = '/home/'
  # LOGOUT_REDIRECT_URL = 'index/'
  
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'jijiapp',
      'jijistore',
      'crispy_forms',
      'multiupload',
      'crispy_bootstrap4',
      # 'channels',
  ]
  
  CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'jijiclone.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'jijiclone.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': BASE_DIR / 'db.sqlite3',
      }
  }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/4.0/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_TZ = True
  
  
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/4.0/howto/static-files/
  
  STATICFILES_FINDERS = [
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  ]
  
  
  STATIC_URL = '/static/'
  STATICFILES = [os.path.join(BASE_DIR, 'static/')]
  STATIC_ROOT =os.path.join(BASE_DIR, 'staticfiles')
  
  MEDIA_URL ='/media/'
  
  # Default primary key field type
  # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
  
  DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
  
  
  
  # email setup for gmail
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_PORT =465
  EMAIL_USE_SSL=True
  EMAIL_USE_TLS = False
  EMAIL_HOST_USER = 'mathiaswilfred7@gmail.com'
  EMAIL_HOST_PASSWORD= 'kpvwrumwpoucrdft'
  # EMAIL_HOST_PASSWORD=''

```

this is my local url.py root file as you requested

```
  from django.contrib import admin
  from django.urls import path, include
  from django.conf import settings
  from django.conf.urls.static import static
  from jijiapp.forms import LoginForm
  from django.contrib.auth import views as auth_views
  
  urlpatterns = [
      path('admin/', admin.site.urls),
      path('', include('jijiapp.urls')),
      path('store/', include('jijistore.urls')),
      path('login/', auth_views.LoginView.as_view(template_name='jijiapp/registration/login.html', authentication_form=LoginForm), name='login'),
      # path('accounts/', include('django.contrib.auth.urls')),
      # path('inbox/', include('jijiapp.routing')),
      
      path('accounts/password_reset/', auth_views.PasswordResetView.as_view(
          template_name='jijiapp/registration/password_reset.html'), name='password_reset'),
      path('accounts/password_reset/done/', auth_views.PasswordResetDoneView.as_view(
          template_name='jijiapp/registration/password_reset_done.html'), name='password_reset_done'),
      path('accounts/reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(
          template_name='jijiapp/registration/password_reset_confirm.html'), name='password_reset_confirm'),
      path('accounts/reset/done/', auth_views.PasswordResetCompleteView.as_view(
          template_name='jijiapp/registration/password_reset_complete.html'), name='password_reset_complete'),
  
  ]
  if settings.DEBUG:
      urlpatterns +=static(settings.MEDIA_URL, document_root =settings.MEDIA_ROOT)

```

 ![video_image-TEikASpex](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/8/8e3201121c243f2c05b200685e0b96094e057621.jpeg)  
 ![video_image-o7VsLsRsn](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/1/14c5d4f5cf4e0e194984912fe7982dfdc560b2a3.jpeg)

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 1, 2023, 9:33pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/12 "2023-06-01T21:33:04Z")

</div>

As expected your paths are incorrect.  
And your settings.py file miss the next line  
`MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), "media")`

But in your case write this  
`MEDIA_ROOT = os.path.join(BASE_DIR, "media")`

> [@Wilfred1213](#):
>
> ```auto
> if settings.DEBUG:
> urlpatterns +=static(settings.MEDIA_URL, document_root =settings.MEDIA_ROOT)
> 
> ```

This will work only if the DEBUG is “True”

Also try to use [django-environ](https://pypi.org/project/django-environ/)  
Or take a look at [this](https://forum.djangoproject.com/t/top-5-3rd-party-packages/391)

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [June 1, 2023, 9:38pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/13 "2023-06-01T21:38:37Z")

</div>

this is the update of my media root as you suggested. But up to now the image is not displaying

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

```

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 1, 2023, 9:44pm UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/14 "2023-06-01T21:44:32Z")

</div>

Are you sure that you push your local changes to the server  
Share your server settings.py on the pythonanywhere site

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [June 2, 2023, 5:40am UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/15 "2023-06-02T05:40:41Z")

</div>

Ok, this is my server setting

```
  import os
  from pathlib import Path
  
  # Build paths inside the project like this: BASE_DIR / 'subdir'.
  BASE_DIR = Path( __file__ ).resolve().parent.parent
  
  
  # Quick-start development settings - unsuitable for production
  # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = True
  
  ALLOWED_HOSTS = ['wilfred7.pythonanywhere.com']
  
  
  LOGIN_URL = '/login/'
  LOGIN_REDIRECT_URL = '/home/'
  # LOGOUT_REDIRECT_URL = 'index/'
  
  
  
  # Application definition
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'jijiapp',
      'jijistore',
      'crispy_forms',
      'multiupload',
      'crispy_bootstrap4',
      # 'channels',
  ]
  
  CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap4"
  CRISPY_TEMPLATE_PACK = 'bootstrap4'
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  
  ROOT_URLCONF = 'jijiclone.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.join(BASE_DIR, 'templates')],
          'APP_DIRS': True,
          'OPTIONS': {
              'context_processors': [
                  'django.template.context_processors.debug',
                  'django.template.context_processors.request',
                  'django.contrib.auth.context_processors.auth',
                  'django.contrib.messages.context_processors.messages',
              ],
          },
      },
  ]
  
  WSGI_APPLICATION = 'jijiclone.wsgi.application'
  
  
  # Database
  # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': BASE_DIR / 'db.sqlite3',
      }
  }
  # DATABASES = {
  # 'default': {
  # 'ENGINE': 'django.db.backends.sqlite3',
  # 'NAME': 'Wilfred7$SQLite',
  # 'HOST': 'Wilfred7.mysql.pythonanywhere-services.com',
  # }
  # }
  
  
  # Password validation
  # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
  
  AUTH_PASSWORD_VALIDATORS = [
      {
          'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
      },
      {
          'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
      },
  ]
  
  
  # Internationalization
  # https://docs.djangoproject.com/en/4.0/topics/i18n/
  
  LANGUAGE_CODE = 'en-us'
  
  TIME_ZONE = 'UTC'
  
  USE_I18N = True
  
  USE_TZ = True
  
  STATICFILES_FINDERS = [
      'django.contrib.staticfiles.finders.FileSystemFinder',
      'django.contrib.staticfiles.finders.AppDirectoriesFinder',
  ]
  
  
  MEDIA_ROOT = os.path.join(BASE_DIR, "media")
  MEDIA_URL = "/media/"
  
  STATIC_URL = '/static/'
  STATICFILES = [os.path.join(BASE_DIR, 'static/')]
  STATIC_ROOT =os.path.join(BASE_DIR, 'staticfiles')
  
  
  
  DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

```

---

<div class="post-metadata">

**Author:** ![Wilfred1213](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/wilfred1213/32/7438_2.png) [@Wilfred1213](https://forum.djangoproject.com/u/Wilfred1213)\
**Post date:** [June 2, 2023, 5:53am UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/16 "2023-06-02T05:53:44Z")

</div>

Apologies i gat the problem. Ever since i uploaded the project on pythonanywhere, i never try to upload new image. This morning i uploaded new image and it shows up on the server. Thank you so much for supporting me.

---

<div class="post-metadata">

**Author:** ![cehceh](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cehceh/32/3415_2.png) [@cehceh](https://forum.djangoproject.com/u/cehceh)\
**Post date:** [June 2, 2023, 6:10am UTC](https://forum.djangoproject.com/t/media-files-not-found-on-pythonanywhere/21255/17 "2023-06-02T06:10:47Z")

</div>

Glad to here that

Happy coding
