8 comments

[ 3.4 ms ] story [ 23.7 ms ] thread
Great stuff!

I personally have been using many of these techniques in Django projects of mine, but it's nice to have a repo with everything in the same place.

Specifically - I love the lambda * x hack.

Really great writeup! You should check out Bueda's django-boilerplate repo on Github. Particularly their environment.py file which resolves your dislike for putting site specific apps in the root (it adds them all to the path instead): https://github.com/bueda/django-boilerplate
This is remarkably similar to how I setup my Django settings.py files. The only thing I'd add is I like to have a lib folder and do a sys.path.insert(0, PATH/TO/Lib/Folder) in my manage.py and .wsgi files. This makes it really easy to manage dependencies. The other option is to use virtualenv, but in my experience it falls down pretty hard on modules that require C bindings, so why not just manage it manually? In addition, if you use git, you can take advantage of git's submodule functionality to really easily keep track of specific versions of your submodules.

I was actually in the middle of a similar writeup that includes the above tips, so I'll post that when I'm done.

> virtualenv... falls down pretty hard on mouldes that require C bindings

Care to elaborate? virtualenv has worked fine for me and that plus pip means that the rest of the community can use and understand your code and all of its dependencies without having to have access to you or your machine to figure them out.

It's possible that I simply haven't made enough effort, but trying to get PIL and Reportlab working from a virtualenv has been an uphill battle.

I'd really like those libraries to work on OSX, Linux & Windows, but so far it has been easier to just install those two packages on the machines I need them on.

Nice post. I like that it explains why you like this layout.

I'm working on my first real Django project now and as a newbie I found the lack of a clear consensus on how to structure the files a bit of a challenge.

Great article. Might use a few ideas in http://www.djangocanvas.com, I sitll haven't finalized the project structure and will likely support multiple ones.
oh I like your idea. is it opensource? I'd like to try helping you