views:

648

answers:

3

I came across many resources about the difference between Django projects and reusable apps, most prominently the DjangoCon talk, and Pinax Project.

However, being a newbie, writing my own projects and reusable software seems to a bit challenging. I don't quite understand how where models go (and how apps can be flexible and permissive), where the templates go, and how the different apps mesh together.

Are there any tutorials on creating a project with reusable apps? Good practices page? Most preferably, a sample project with its own apps (rather than depend on external apps)?

I am aiming to understand the architecture of a project and interaction between apps rather than just building reusable apps. Most tutorials I came across online are about building a reusable app, or building a simple monothelic blog app that only has external dependencies on builtin or django.contrib modules.

+4  A: 

James Bennett's Practical Django Projects does a pretty good job of covering those topics in general and even includes a chapter specifically on "Writing Reusable Django Applications" that goes through an example of splitting one of the example projects in the book out into its own app.

thraxil
+2  A: 

You can watch video (DjangoCon 2008: Reusable Apps) - http://www.youtube.com/watch?v=A-S0tqpPga4 and get the idea, how to use it.

There are a lot of reusapbe apps at Google, djangosnippets, git, etc. Most popular:

  • django-contact-form - feedback form;
  • django-debug-toolbar - watch sql queries and etc;
  • django-registration + django-profiles - skip regs routines;
  • django-mptt - use tree structure;
  • django-pagination - usefull per-page viewer;
  • django-stdimage or sorl-thumbnail - image routines;
  • south - schema migrations;

Read samples docs and save your dev-time. Good luck!

hardtop
Thanks! This is the lecture I linked to. I was hoping to see sample projects with reusable apps interacting with each other, rather than just reuseable app.
notnoop
@msaeed - sorry - i've missed your link ;-). Look at django-pagination: http://code.google.com/p/django-pagination/ - there is small screencast about implementing pagination at page
hardtop
+1  A: 

If you want to see "sample projects with reusable apps interacting with each other," there's no better place to go than downloading Pinax, cloning one of their sample projects (just follow the docs) and reading through the code carefully.

Carl Meyer