jeudi 28 novembre 2019

Django managing the icons and images

This is a Best practice question about how to manage my media in my django site.

I know this is not an "confusion with a code snippet" question like the most of the questions, but seriously i could imagine that this is a dilemma of some of the web developers.

Instead of managing all of my media content by a model with a key of ImageField key like this:

class myLogos(models.Model):
   foo = models.ImageField(upload_to = 'media/')

I was thinking its more "manageable" to store all of my media content in a kind of separated server, and to call a specific image everytime from my template, like this:

<img src="https://www.mysitepictures.com/app1/foo1.png" alt="Smiley face" height="42" width="42">
<img src="https://www.mysitepictures.com/app2/foo2.png" alt="Smiley face" height="42" width="42">

The reason is, i found it way too complicated to display images in an django project with multiple applications on it.

Is that a great idea to have kind of an third party server just for calling the images from it?

If not, then how should i manage a huge django project with a hundreds of images on the whole site?

Thanks!




Aucun commentaire:

Enregistrer un commentaire