Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you divide your project into applications in Django?

Tags:

django

I am not really sure how to divide my Django projects into applications.

What things should I consider when laying out a Django project?

like image 612
satoru Avatar asked Jan 18 '10 14:01

satoru


1 Answers

James Bennett has written a blog entry about this,

Django tips: laying out an application, section "Projects versus applications":

An application tries to provide a single, relatively self-contained set of related functions. An application is allowed to define a set of models (though it doesn’t have to) and to define and register custom template tags and filters (though, again, it doesn’t have to).

A project is a collection of applications, installed into the same database, and all using the same settings file. In a sense, the defining aspect of a project is that it supplies a settings file that specifies the database to use, the applications to install, and other bits of configuration. A project may correspond to a single website, but doesn’t have to — multiple projects can run on the same site. The project is also responsible for the root URL configuration, though in most cases it’s useful to just have that consist of calls to include which pull in URL configurations from individual applications.

like image 124
Peter Mortensen Avatar answered Sep 20 '22 23:09

Peter Mortensen