Interesting! Didn't know document_root would figure out relative
paths. Glad you got it working.

Re. media -- yeah, sorry about that, I've taken to renaming the
admin's to media_admin.

On Jul 20, 12:26 pm, cjl <[EMAIL PROTECTED]> wrote:
> Nathan:
>
> Thank you for your reply.
>
> Your solution seems practical, but I found another solution. In
> 'settings.py' I have:
>
> MEDIA_ROOT = './static/'
> MEDIA_URL = 'static/'
>
> and in 'urls.py' I have:
>
> (r'^static/(?P<path>.*)$', 'django.views.static.serve',
> {'document_root': 'static'}),
>
> Then in the templates I can have:
>
> <img src="http://localhost:8000/static/picture.png";>
>
> Which seems to work for me, and avoids any hardcoded paths for my
> tutorial.
>
> Also, note that with your solution calling your media url 'media' will
> clash with the default name for admin media, although I'm sure that
> you knew that, and that you were only providing an example.
>
> Thanks again,
> cjlesh


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to