from api.views import GraphQLView
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    path("admin/", admin.site.urls),
    path("graphql", csrf_exempt(GraphQLView.as_view()), name="graphql"),
    path("user/", include("users.urls")),
    path("", include("social_django.urls", namespace="social")),
    path("", include("payments.urls")),
]

from api.views import GraphQLView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    path("admin/", admin.site.urls),
    path("graphql", csrf_exempt(GraphQLView.as_view()), name="graphql"),
    path("user/", include("users.urls")),
    path("", include("social_django.urls", namespace="social")),
    path("", include("payments.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Add media url when running in debug mode
Add media url when running in debug mode

  from api.views import GraphQLView
+ from django.conf import settings
+ from django.conf.urls.static import static
  from django.contrib import admin
  from django.urls import include, path
  from django.views.decorators.csrf import csrf_exempt
  
  urlpatterns = [
      path("admin/", admin.site.urls),
      path("graphql", csrf_exempt(GraphQLView.as_view()), name="graphql"),
      path("user/", include("users.urls")),
      path("", include("social_django.urls", namespace="social")),
      path("", include("payments.urls")),
- ]
+ ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  
Add media url when running in debug mode
## Code Before:
from api.views import GraphQLView
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    path("admin/", admin.site.urls),
    path("graphql", csrf_exempt(GraphQLView.as_view()), name="graphql"),
    path("user/", include("users.urls")),
    path("", include("social_django.urls", namespace="social")),
    path("", include("payments.urls")),
]

## Instruction:
Add media url when running in debug mode
## Code After:
from api.views import GraphQLView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    path("admin/", admin.site.urls),
    path("graphql", csrf_exempt(GraphQLView.as_view()), name="graphql"),
    path("user/", include("users.urls")),
    path("", include("social_django.urls", namespace="social")),
    path("", include("payments.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
