Django Db Images Video

How to save images, video and audio through Django in mysql db?

I know that I can either save a link to an image, video, audio or image, video, audio.

But how exactly does it work.

I know about models and how they create tables through manage.py. But is there a good tutorial on how to create a database (e.g. jpg, tiff, etc.) Via Django.

thanks

l

+4
source share
2 answers

Daniel refers to storing large binary files in a database as inefficient. Use the file system instead - look at FileField and ImageFileField, which are designed to handle files:

http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield

The only thing that is stored in the database is the path to the binary file.

+2
source

No, there is no tutorial on this. Django does not support it out of the box, and it is terribly inefficient. Do not do this.

0
source

Source: https://habr.com/ru/post/1313844/


All Articles