Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Reuseable Apps

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.

like image 300
notnoop Avatar asked Dec 16 '25 15:12

notnoop


2 Answers

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.

like image 143
thraxil Avatar answered Dec 19 '25 03:12

thraxil


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!

like image 25
hardtop Avatar answered Dec 19 '25 05:12

hardtop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!