joedevon
joedevon

Reputation: 2689

Django admin file upload doesn't work, how do I debug this?

I'm on Mac Leopard. Trying to get django admin file uploads, or really image uploads to work. In my app's models.py I set the field to:

image = models.FileField(upload_to='images', max_length=500)

(started w/ ImageField, but thought if a file doesn't work, then the image for sure won't work)

It says the upload happened. Gives me a positive result. Saves the path to my database. But looking for the file, well, it isn't there.

Since there's no error message, it's hard to debug. Tried various permissions, but nothing is working.

Any ideas?

Upvotes: 4

Views: 5426

Answers (2)

John Debs
John Debs

Reputation: 3784

From the comments it sounds like you found a solution to your issue. For future reference, you may want to check out django-debug-toolbar to help you troubleshoot problems like this (Especially when there's no error, it just doesn't work right!). Code available here: http://github.com/robhudson/django-debug-toolbar/tree/master

Upvotes: 2

Ellie P.
Ellie P.

Reputation: 4153

Is your MEDIA_ROOT set correctly? http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield

Upvotes: 5

Related Questions