Note that there are some explanatory texts on larger screens.

plurals
  1. POShould I keep my site media in my website's repository?
    text
    copied!<p>I have a simple blog application written in Python, using Django. I use Git to version-control this website. The main content of the site is a blog. The blog entries are stored in a SQLite database (which is <em>not</em> version-controlled, but is backed up regularly); some entries contain images and other media (like PDFs).</p> <p>I currently store this "blog media" in the repository, alongside other media (such as external JavaScript code, and images used for layout purposes -- all nicely organized, of course). It occurred to me, however, that this isn't really a good strategy, for a few reasons:</p> <ol> <li>Whenever I post a new blog entry that contains an image or a link to a PDF, I have to add the image to the repo and then copy a new version to the production server -- which seems like a lot of work just to add an image. It'd be easier just to upload the image to the server (and make a local backup, of course).</li> <li>Since this media is <em>content</em> rather than <em>code</em>, it doesn't seem necessary to store it alongside the code (and related style media) itself.</li> <li>The repo contains a lot of binary files, which increase the overall size of the repo; and more importantly,</li> <li>I never really edit these images, so why keep them under version-control?</li> </ol> <p>So I'm considering removing these files from the repo, and just copying them to a directory on the server outside of the directory containing the Python code, templates, style sheets, etc., for the website.</p> <p>However, I wondered: Is there a "best practice" for dealing with content images and other media in a website's repo, as opposed to images, etc., that are actually used as part of the site's layout and functionality?</p> <hr> <h2>Edit</h2> <p>To elaborate, I see a difference between keeping the <em>code</em> for the website in the repo, and also keeping the <em>content</em> of the site in the repo -- I feel that perhaps the <em>content</em> should be stored separately from the code that actually provides the <em>functionality</em> of the site (especially since the content may change more frequently, and I don't see a need to create new commits for "stuff" that isn't necessary for the functioning of the site itself).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload