Answer the question
In order to leave comments, you need to log in
How to make a filefield image appear on the site?
Please tell me, I can not upload a photo from the admin panel.
It does not appear in the template.
Registered in the settings:
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'media_cdn')
MEDIA_URL = '/media/'
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
class Book(models.Model):
image = models.FileField(blank = True, null=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question