Access date a picture was taken

4 views
Skip to first unread message

Simon D

unread,
Oct 19, 2013, 12:53:37 PM10/19/13
to django...@googlegroups.com
Hi,

I'm developing a blog, and want Django to automatically store the date a picture was taken in the database. Is there a way to do this is Django?

I found something like Github which would have this option I think, but it comes with a lot of other stuff I don't need. Is there a simple way, without having to install anything?

Thanks in advance,

Simon

Oscar Carballal

unread,
Oct 19, 2013, 3:17:28 PM10/19/13
to django...@googlegroups.com
You can do it via de PIL library, which you need to have installed for using images in Django. Take a look to the approved answer in this SO question: http://stackoverflow.com/questions/4764932/in-python-how-do-i-read-the-exif-data-for-an-image

You can invoke the code for obtaining the date on the save() event and populate the corresponding field you want before saving the object, it's fairly straightforward :)


2013/10/19 Simon D <simon.del...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cf069788-4c0d-4279-927a-c24438f7ab9f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages