Django / Python

Django Resim Dosyası

model

image= models.ImageField(upload_to='/images/')

settings.py

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

urls.py

from django.conf.urls.static import static
from django.conf import settings
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

 

 

4 1 vote
Article Rating
Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments