thanks but it doesn't work MEDIA_URL = '/media/' MEDIA_ROOT = 'media' On Thursday, March 14, 2019 at 2:36:35 PM UTC+2, Chetan Ganji wrote: > > Did you setup MEDIA-ROOT location in your settings.py > For reference - > https://docs.djangoproject.com/en/2.1/ref/settings/#media-root > > Regards, > Chetan Ganji > +91-900-483-4183 > [email protected] <javascript:> > http://ryucoder.in > > > > <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=7ce9710f-d0c2-48a2-a0ba-76107578348e> > I’m > protected online with Avast Free Antivirus. Get it here — it’s free > forever. > <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=7ce9710f-d0c2-48a2-a0ba-76107578348e> > > <#CAMKMUjvxSdyNqJan2MjVcsR+igpMsj-+xZonEUTLt8HKoXBnKA@mail.gmail.com_m_4678954581711788864_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > On Thu, Mar 14, 2019 at 5:43 PM omar ahmed <[email protected] > <javascript:>> wrote: > >> this is my model >> class LeagueNews(models.Model): >> ... >> news_image = models.ImageField(upload_to='core/media/core',max_length=255, >> null=True,blank=True) >> >> >> and this is my template >> >> >> {% block content %} >> >> <h1 style="color:deeppink;">{{ article.news_title }}</h1> >> >> <h6>{{ article.publication_date }}</h6> >> >> <p>{{ article.news_text }}</p> >> >> <img src="{{ article.news_image }}" height="200"/> >> >> {% endblock %} >> the view >> >> def newsdetail(request, news_id): >> article = get_object_or_404(LeagueNews,pk=news_id) >> return render(request, 'core/newsdetail.html',{'article':article}) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/1d4123b8-c5bc-4bed-8888-51bb142f21b0%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/1d4123b8-c5bc-4bed-8888-51bb142f21b0%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=7ce9710f-d0c2-48a2-a0ba-76107578348e> > I’m > protected online with Avast Free Antivirus. Get it here — it’s free > forever. > <https://www.avast.com/en-in/recommend?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=default3&tag=7ce9710f-d0c2-48a2-a0ba-76107578348e> > > <#CAMKMUjvxSdyNqJan2MjVcsR+igpMsj-+xZonEUTLt8HKoXBnKA@mail.gmail.com_m_4678954581711788864_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> >
-- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0a3a9cd6-83e8-4c58-ae74-2173886ae8f5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

