No settings.py 

MEDIA_ROOT = os.path.join(ROOTDIR, 'media')
MEDIA_URL  = '/media/'

urls.py
# arquivos de media-uploads
    (r'^media/(.*)$', 'django.views.static.serve',
        {'document_root': settings.MEDIA_ROOT}),


no .html
{% for item in lista_itens %}
    <img src="{{ MEDIA_URL }}{{ item.imagem }}" alt="Imagem" />

{% endfor %}



Altera
imagem = models.ImageField(upload_to='C:/Projeto Budega das 
artes/budegadasartes/media/imagens_ventos',)

para algo como: imagem = models.ImageField(upload_to='sua_pasta_de_images/') 
Já que o ROOTDIT te dará um caminha absoluto.



Em segunda-feira, 14 de julho de 2014 12h04min05s UTC-3, Carlos Andre 
escreveu:
>
> Olá pessoal, estou tentando usar um slideshow e uso um for para iterar as 
> imagens que passam vidas de um repositório, problemas que funciona sem o 
> comando for no template, quando adiciono ele mostra nada para! 
> Pelo que vejo há problemas no reconhecimento dos comandos de templates, 
> caso como o que tenho que usar o caminho do path todo, não está 
> reconhecendo o media. As configurações do settings.py foram feitas e 
> apontam para a pasta das imagens. Se alguém poder me ajudar agradeço, não 
> coloquei trechos do código para não receber criticas por incluir código 
> aqui! 
>
>
> Hello guys, I'm trying to use a slideshow and use one is to iterate 
> through the images that pass a repository lives, works without problems 
> that the command is in the template, when I add anything to it shows! 
> I see no problems in recognizing commands templates, as if I have to use 
> the path of the whole path is not recognizing the media. Settings.py 
> settings were made and point to the folder of images. If someone could help 
> me thank you, excerpts did not put the code to not be criticized for 
> including code here!
>  

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5fda1403-a605-4b49-a92b-ff618abd32ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to