I want to render an image via a template, but the template can't show
image, but only a small image symbol..
My settings:
MEDIA_ROOT = '/home/mehmet/internet_projeleri/site4ust/site4/media'
MEDIA_URL = '/media/'
STATIC_ROOT = ' '
STATIC_URL = '/unnamed/'
I have a template in
'/home/mehmet/internet_projeleri/site4ust/site4/templatelerim', which has
the following line:
<img src="{{ MEDIA_URL }}/60830071673353216.jpg" />
I also added last pattern to the .../site4/urls.py:
urlpatterns = patterns(' ',
url(r'^giris/$', 'unnamed.views.giris'),
url(r'^anasayfa/$', 'unnamed.views.anasayfa'),
url(r'^upload/$', 'unnamed.views.dosya_yukle'),
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
)
What is the problem..
On Saturday, April 6, 2013 1:27:54 PM UTC+3, Fatih Tiryakioglu wrote:
>
> <img
> src="/home/mehmet/internet_projeleri/site4ust/unnamed/60830071673353216" />
>
> And in the settings:
>
> MEDIA_ROOT = '/home/mehmet/internet_projeleri/site4ust/site4/media'
> MEDIA_URL = '/media/'
> STATIC_ROOT = ' '
> STATIC_URL = '/static/'
>
> I have a template in
> '/home/mehmet/internet_projeleri/site4ust/site4/templatelerim', which has
> the following line:
> <img src="
>
--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.