Thanks a lot.
I do the following steps:
aggregate an alias to the virtual host of my site:
Alias /media /var/www/fourweb/media/
and modified:
settings.MEDIA_ROOT = '/var/www/fourweb/media/'
settings.MEDIA_URL = 'http://fourweb.com/media/'
it works!.
Cheers
Ronny
El martes, 21 de mayo de 2013
On Wed, May 22, 2013 at 2:10 AM, Ronny Villarroel Mendoza
wrote:
> Hi all,
>
> I cant show the picture that I upload from the admin site.
>
>
> settings.py:
>
> MEDIA_ROOT = '/var/www/fourweb/'
>
>
>
> models.py:
>
> class picture(models.Model):
> producto_id = models.ForeignKey(producto)
>
I'm new to Django and I've been struggling with getting ImageField to
upload images.
I have a very simple model that I want to use to store images:
class WriteupImage(models.Model):
writeup=models.ForeignKey(Writeup)
image = models.ImageField(upload_to="writeup/photos/")
I have a form wi
The problem with this issue finally had nothing to do with the forms
themselves, but the __unicode__ method of the Image-model.
Older implementations of ImageField had a __unicode__ method of their own
so
def __unicode__(self):
return self.file
worked fine. Now this needs to be
def __unicode
Hi,
I have similar models and wanted to do the same thing. Here's how I
got my inline to work (using your provided models as an example).
class Entry(models.Model):
pub_date = models.DateTimeField('date published')
created = models.DateTimeField(auto_now_add=True, editable=False)
ed
Hi.
I'm stumped and can't figure out a solution for the following:
With the models:
class Entry(models.Model):
pub_date = models.DateTimeField('date published')
created = models.DateTimeField(auto_now_add=True, editable=False)
edited = models.DateTimeField(auto_now=True, editable=Fal
On 15-09-2005, at 4:38, Kenneth Gonsalves wrote:
false alarm - i tried with a model where there was exactly one filed -
the image field and it worked. The problem obviously lies in some
other
part of the model i was using. I was misled because the imagefield was
being stored as a blank.
On Wednesday 14 Sep 2005 4:25 pm, Matthew Marshall wrote:
> On Wednesday 14 September 2005 08:25 am, lawgon wrote:
>
>
> > File
> > "/usr/local/lib/python2.4/site-packages/django/core/meta/fields.py"
> >, line 320, in get_db_prep_save
> > value = value.strftime('%Y-%m-%d')
> >
> > AttributeEr
On Wednesday 14 September 2005 08:25 am, lawgon wrote:
> File
> "/usr/local/lib/python2.4/site-packages/django/core/meta/fields.py",
> line 320, in get_db_prep_save
> value = value.strftime('%Y-%m-%d')
>
> AttributeError: 'str' object has no attribute 'strftime'
>
> i realise that this has so
I am having a problem with ImageField saving. I am running admin from
mod_python with apache2. I put an absolute path to the 'upload_to'
option. When i press save, the imagefile gets uploaded to the directory
specified in the 'upload_to' option, but this does not get saved i
10 matches
Mail list logo