I have installed the Django Development Server on my computer.  I am
trying to add some css and images to my project.  I'm having problems
getting my pictures to upload correctly.  Below is the details of some
of my files.

setting.py

MEDIA_ROOT = ''

/////////////////////////////////

urls.py

(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': 'c:/django/site_media/', 'show_indexes': True}),

///////////////////////////////////

models.py

class members(models.Model):
    title = models.CharField(maxlength=100)
    names = models.CharField(maxlength=100)
    theslug = models.SlugField(prepopulate_from=["names"])
    email = models.EmailField()
    city = models.CharField(maxlength=100)
    state = models.USStateField()
    image = models.ImageField(upload_to='c:/django/site_media/')


When i have 'image = models.ImageField(upload_to='c:/django/
site_media/')' defined I am able to login to my admin and successfully
add the image.  However, when i go to view the image (in a webpage) in
my browser the picture doesn't show up.  My template shows the image
by using the following html '<img src="{{ thetabinfo.image }}"'.
However, this contains the string 'c:/django/site_media/image.jpg'.
This should say '/site_media/image.jpg'.  However, when i change my
model field to 'image = models.ImageField(upload_to='/site_media/')'
The image never gets uploaded to the folder.

Thanks for any help


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