So I have a model that looks like this:
class FirmwareUpload(models.Model):
# represents a POSTed VSSL file
firmwarefile = models.FileField(upload_to="uploads/")
tweaks = models.FileField(upload_to="uploads/")
postreleasetweaks = models.FileField(upload_to="uploads/")
creation_time = models.DateTimeField(auto_now=True)
class Admin:
fields = (
(None,
{'fields':('firmwarefile','tweaks','postreleasetweaks' )}),
("Date information", {"fields":('creation_time',), }),
)
def __str__(self):
return self.firmwarefile
In my settings.py I have: MEDIA_ROOT = '/home/parlarjb/media/'
The main use of my app is for users to upload their files via a
template I have. That's fine and working nicely now. The uploaded
files properly end up in /home/parlarjb/media/uploads/
The problem though, is accessing those uploaded files from the Admin.
When I go to one of these rows in the Admin, I get the expected
"Currently" link, and a new upload box labelled "Change".
When I click on the "Currently" link though, it tries to send me to
http://localhost:8000/admin/firmware/firmwareupload/1/uploads/2006-05-19/somefile.txt
and I get a 404.
Is there any way to make clicking on that link take me straight to the
file? I thought that having a specified MEDIA_ROOT would cause that to
happen automatically, but I guess not.
And as a side note, if I call the get_firmwarefile_url() for one of
the records, I just get a relative url, 'uploads/somefile.txt', and
not an absolute URL. Is that related?
Thanks,
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---