Skip to content Skip to sidebar Skip to footer

How To Upload File In A Specific Address Using Django Admin Panel?

I'm Developing a django admin panel that has image upload capability ,image upload works successfully , but i cant access to images from entering urls in browser . When I want to

Solution 1:

In your main urls.py add pattern for them like below.

urls.py

...
from django.conf import settings
from django.conf.urls.static import static
...

urlpatterns = [
    ...
]

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

settings

MEDIA_URL = '/media/'

Post a Comment for "How To Upload File In A Specific Address Using Django Admin Panel?"