Thursday, July 31, 2014

Re: image upload

no

On Thursday, July 31, 2014 4:43:15 PM UTC+1, cmawe...@gmail.com wrote:
Are you using <img src="{{ image.image.url }}" >  ?

On Thursday, July 31, 2014 7:20:19 AM UTC-4, ngangsia akumbo wrote:
i have a problem of displaying my image on my web page.

i have upload my pic in admin and when i display it it shows me the  this

media/Lighthouse_1.jpg

models.py

class Image(models.Model):
    title = models.CharField(max_length=60, blank=True, null=True)
    image = models.FileField(upload_to="images")


<div id="content">
<div id="content_plate">

<h2> {{ blogs.title }} - Date Published: {{blogs.pub_date}} </h2>
<p> {{ blogs.content|safe}} <br />Tags: {{ blogs.photo }}</p> 
<h2> Reported By: {{blogs.reporter}} </h2>
</div>
<div id='link_back'>
<ul>
<p>Return back to Main Page</p>
<li><a href="/blog/">News</a></li>
</ul>
 
</div>
{% endblock %}




MEDIA_ROOT = 'C:/Python27/Scripts/testproject/Django-1.4.3/django/bin/test0/images/'
MEDIA_URL = '/media/'

STATIC_ROOT = '' "
STATIC_URL = '/static/'







--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9889f679-b424-477c-a276-f44a2e395ce2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment