0

How to save image in db from django model? I donot want to upload it in any folder , just want to save it in db from models.

Avinash Garg
  • 1,374
  • 14
  • 18

1 Answers1

3

If you have to store binary data then Django (1.6 only) offers models.BinaryField.

It is important to note that the docs state:

Although you might think about storing files in the database, consider that it is bad design in 99% of the cases. This field is not a replacement for proper static files handling.

Joseph Victor Zammit
  • 14,760
  • 10
  • 76
  • 102