title: django imagefield upload_to does not work at all
body: <p>I've written a simple django app to test ImageField, but I'm running into problem where upload_to just doesn't seem to work. Below is the code:</p>
  
  <pre><code>  1 from django.db import models
    2 
    3 # Create your models here.
    4 class TestImage(models.Model):
    5     img = models.ImageField(max_length=256, upload_to='images')
  </code></pre>
  
  <p>In my settings.py I have:</p>
  
  <pre><code>  2 from os.path import dirname, join, abspath
    3 __dir__ = dirname(abspath(__file__))
   50 MEDIA_ROOT = join(__dir__, 'static')
   55 MEDIA_URL = '/media/'
  </code></pre>
  
  <p>Then I start python shell using manage.py:</p>
  
  <pre><code>jchin@ubuntu:~/workspace/testimage$ ./manage.py shell
  Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
  [GCC 4.5.2] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  (InteractiveConsole)
  &gt;&gt;&gt; import settings
  &gt;&gt;&gt; from image_app.models import TestImage
  &gt;&gt;&gt; p = TestImage(img='test.jpg')
  &gt;&gt;&gt; p.save()
  &gt;&gt;&gt; p.img.name
  'test.jpg'
  &gt;&gt;&gt; p.img.path
  u'/home/jchin/workspace/testimage/static/test.jpg'
  &gt;&gt;&gt; p.img.url
  '/media/test.jpg'
  </code></pre>
  
  <p>As you can see from the result, django totally ignored my 'upload_to' paramater. Which I can't figure out why. From the documentation I should be expecting p.img.path to return "/home/jchin/workspace/testimage/static/images/test.jpg" and in the DB storing "images/test.jpg", correct?  But the DB simply store the file name only:</p>
  
  <pre><code>mysql&gt; select * from image_app_testimage;
  +----+-----------+
  | id | img       |
  +----+-----------+
  |  1 | test.jpg  |
  +----+-----------+
  1 rows in set (0.00 sec)
  </code></pre>
  
  <p>I checked all the documentations and I could not find what I am doing wrong. Anyone have any ideas?  I'm using django 1.2.5 and it should support upload_to.</p>
  
  <p>Please help!
  John</p>