Opened 18 years ago

Closed 18 years ago

#2423 closed defect (worksforme)

Admin uploads go to admin media folder, not MEDIA_ROOT

Reported by: Tyson Tate <tyson@…> Owned by: Adrian Holovaty
Component: contrib.admin Version: dev
Severity: normal Keywords: upload_to
Cc: tyson@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have the following settings in my settings.py file:

MEDIA_ROOT = '/Users/ttate/Desktop/fallingbullets/project-media/'
MEDIA_URL = 'http://localhost:8000/project-media/'
ADMIN_MEDIA_PREFIX = '/media/'

I also have a model with the following:

image = models.ImageField(upload_to="portfolio", core=True)

When I use the admin interface to upload an image, it gets placed in /media/portfolio and not /project-media/portfolio, where it should have gone.

Change History (4)

comment:1 by Tyson Tate <tyson@…>, 18 years ago

Cc: tyson@… added

comment:2 by Tyson Tate <tyson@…>, 18 years ago

After deleting all uploaded images and their associated database entries, uploads are completely broken. Uploading appears to work, but no files are actually uploaded to the media directories. The console gives no error messages at all.

comment:3 by Tyson Tate <tyson@…>, 18 years ago

Reverting to the following settings seems to make things work. I hope. :/

MEDIA_ROOT = '/Users/ttate/Desktop/fallingbullets/media/'
MEDIA_URL = 'http://localhost:8000/media/'
ADMIN_MEDIA_PREFIX = '/media/admin/'

comment:4 by Tyson Tate <tyson@…>, 18 years ago

Resolution: worksforme
Status: newclosed

No one on IRC was able to reproduce this problem, so I'm marking as worksforme until it comes around and bites me, again. Hopefully I'll have better debug info about why it happens next time.

Note: See TracTickets for help on using tickets.
Back to Top