Best practice for Django project working directory structure [closed]

I know there is actually no single right way. However I’ve found that it’s hard to create a directory structure that works well and remain clean for every developer and administrator. There is some standard structure in most projects on github. But it does not show a way to organize another files and all projects on pc.

What is the most convenient way to organize all these directories on development machine? How do you name them, and how do you connect and deploy this to server?

  • projects (all projects that your are working on)
  • source files (the application itself)
  • working copy of repository (I use git)
  • virtual environment (I prefer to place this near the project)
  • static root (for compiled static files)
  • media root (for uploaded media files)
  • README
  • LICENSE
  • documents
  • sketches
  • examples (an example project that uses the application provided by this project)
  • database (in case sqlite is used)
  • anything else that you usually need for successful work on project

The problems that I want to solve:

  • Good names of directories so that their purpose is clear.
  • Keeping all project files (including virtualenv) in one place, so I can easily copy, move, archive, remove whole project or estimate disk space usage.
  • Creating multiple copies of some selected file sets such as entire application, repository or virtualenv, while keeping single copy of another files that I don’t want to clone.
  • Deploying right set of files to the server simply by rsyncing selected one dir.

6 Answers
6

Leave a Comment