#in base url
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
#in setting
MEDIA_URL='/media/
MEDIA_ROOT=BASE_DIR / 'media'
### add the following lines in Project settings.py ###
MEDIA_URL='/media/'
MEDIA_ROOT=BASE_DIR / 'media'
### add the following lines in Project urls.py ###
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# put here your urls
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
### now once you add another object a media folder will be created ###
### in the base folder and you can use it ###
### remember to add .url when viewing the image in html ###
### Ex. obj.Image_Propertey_Name.url ###
#in base url
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
#in setting
MEDIA_ROOT = BASE_DIR / 'media'
MEDIA_URL = '/media/'
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# ----------------or----------------
# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)