I have been having problem uploading image from admin and for it to deplay 
on the page

Here is my config

               
templates

   1.  <img src="{{ MEDIA_URL }}{{ image.image.url }}" height="100"></a>


settings.py


   1. MEDIA_ROOT = '/home/yems/var/www/bluepearlhotel/media/'
   2. MEDIA_URL = 'http://www.127.0.0.1:8000/media/'


models.py


   - image = models.ImageField(upload_to='images/', blank=True)


views .py

def detail_post(request, blogs_id):
    try:
        blogs = Post.objects.get(pk=blogs_id)
    except Post.DoesNotExist:
        raise 404
    return render_to_response('detailp.html', {'blogs': blogs})


urls 
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
#new urls
    url(r'^blog/$', 'blog.views.list_post'),
    url(r'^blog/(?P<blogs_id>\d+)/$', 'blog.views.detail_post'),
 #events urls
    url(r'^event/$', "event.views.list_event"),
    url(r'^event/(?P<events_id>\d+)/$', "event.views.detail_event"),

#image urls
    url(r'^gallery/$', "gallery.views.list_gallery"),
    url(r'^gallery/(?P<gallery_id>\d+)/$', "gallery.views.detail_gallery"),
    
#url(r'^gallery/(?P<galley_id>\d+)/album/$',"gallery.views.detail_album"),

 #HOME URL
    url(r'^home/$', "home.views.list_home"),
    url(r'^home/(?P<homes_id>\d+)/$', "home.views.detail_home"),



    url(r'^admin/', include(admin.site.urls)),

)

When i upload an image it actually upload to the right position, but when i 
open the page i shows image break

when i do inspeck element i see this


   1. <img src="" height="100"></a>

Please i need help

-- 
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+unsubscr...@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/c9aee775-fbe8-4078-9265-1658edeaae32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to