What is the recommended directory layout for third-party static files in Django projects?

css, django, django-staticfiles, javascript

Solution

The last approach is much better.

- You can simply unzip the third party library and paste the folder. You need not manually copy and paste each file to different folders.

- You can also use front-end package management tool (which I recommend) like bower with the directory structure.

- You may not need to tweak the third party directory structure into css, js and images.. You can leave whatever it has.

If your project is a bit larger, you may consider creating a different directory for each of the apps you have created.

This the directory structure which I generally follow:

myproject/
  myproject/
    static/
      my_app_1
        css/
        img/
        js/
      my_app_2
        css/
        img/
        js/
      lib/
        bob/
          what_ever_directory_str_it_has
        joe/
          css/
          img/
          js/ 

Problem

For third-party (jquery) code in my Django project, I've adopted a directory structure for my static files that puts all third-party files in a separate `lib` sub-directory. More specifically, this is what my directory tree currently looks like: ``` myproject/ myproject/ static/ css/ my-own-stylesheet.css lib/ bobs-stylesheet.css joes-stylesheet.css img/ my-own-image.png lib/ bobs-image.png joes-image.png js/ my-own-javascript.js lib/ bobs-javascript.js joes-javascript.js ``` This is meant to accomplish two things: 1. Separating my own assets from third-party assets. 2. Separating css, img, and js files. Of course, as long as the paths are all correct, this works fine, but is there actually a convention for a location for third-party material in Django projects? I've also considered ``` myproject/ myproject/ static/ css/ img/ js/ lib/ bob/ css/ img/ js/ joe/ css/ img/ js/ ``` I wonder if I may be overthinking this, but is there a "best-practice" for this?

Original source