Working with images in django?

1) There are 2 models of Goods and Kartingistov
Kartingistov bound key one-to-many with products one product can have many images
So how to combine so that you can immediately add products with images in the admin?

2) I understand I create this code for each image its url
from django.conf import settings
from django.conf.urls.static import static

mapping includes = [
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


static() - the documentation says
"Helper function to return a URL pattern for serving files in debug mode"
that is when I will throw in hosting and disable DEBUG , this function will not work?
April 7th 20 at 10:57
1 answer
April 7th 20 at 10:59
Solution
1. InlineModelAdmin
2. As for the test, not in prod statics distributes a web server, not django. Need to set up MEDIA_URL and MEDIA_ROOT

All this is at the docks left to learn to read them.
forgot one more question
how to make so that when you remove the product images from the media, too, needs removed - diana_Wilderman commented on April 7th 20 at 11:02
@diana_Wilderman, https://stackoverflow.com/questions/28896237/overr... - pietro.Yundt71 commented on April 7th 20 at 11:05

Find more questions by tags Django