On 1/17/07, Isaac Alston <[EMAIL PROTECTED]> wrote:
Ok, I figured this part out. I looked at the stockphoto/models.py
code, and discovered it was doing something like STOCKPHOTO_URL[-1],
which was obviously causing the error, but I couldn't work out why.
Then I realised that if STOCKPHOTO_URL was already defined in
settings.py as '' then it would be trying to index an empty string
(which would fail). I removed my entries to STOCKPHOTO_URL and that
error has now disappeared.

Now everything is at a default install, but it's not fixed anything,
the link in admin is still:
http://127.0.0.1:8000/admin/stockphoto/photo/5/stockphoto/2007/01/17/newser.jpg
for example. Highly frustrating.

I still don't have a good idea of what your settings currently are.
Could you paste in your various media settings, as well as the current
stockphoto settings?

My guess as to why the link is being generated like that is because
you have a relative URL somewhere in there.

The first part of the URL you're getting, namely
"http://127.0.0.1:8000/admin/stockphoto/photo/5"; is the correct URL
for the admin edit page for the stockphoto model. The part after that,
"stockphoto/2007/01/17/newser.jpg" is roughly the correct path to the
actual file. BUT, that path should be a child of the media directory,
not of the admin edit page.

The problem is most likely with your MEDIA_URL. Make sure it ends with a '/'

Jay P.

--~--~---------~--~----~------------~-------~--~----~
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