Note that if these images will be displayed on the site it is best done by
your front end (Apache, ngnx, etc.) since the HTML to show them treats them
as a separate request, and serving static files is your front end's forte.
The front end knows how to do this with files, but probably not with
database blobs.  Thus the design followed by Django (and many other
frameworks) is to store the image as a file, and store something that
allows easy generation of the src attribute of the image tag, such as a
relative or absolute file name.

On Wed, Oct 29, 2014 at 9:14 AM, pjotr <[email protected]> wrote:

> https://docs.djangoproject.com/en/1.7/ref/models/fields/#imagefield
>
> The image file will not be stored in the database, but in MEDIAROOT by
> default. So maybe this is not the answer to your question.
>
> On Wednesday, October 29, 2014 10:18:30 AM UTC+1, Shubham Gupta wrote:
>>
>> Is there  any way from which i can add image  as a field so that images
>> are added into my database?
>> what data type i must use for this problem..?
>> thank you in advance
>>
>>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/b8612d81-a510-43d7-bc7f-57d81b76d686%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/b8612d81-a510-43d7-bc7f-57d81b76d686%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAB%2BAj0tN5rvZNdm76xEdYEt4g0LipSGFTunPz7mXew8-%3D86xMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to