On 08/14/2009 12:36 AM, Vadivel Kumar wrote: > I have recently started on Django .. going awesome .. I know, this > question might have popped out several times before, but since Google > does not yield me any results, I am writing this post. However, do > point out resources if any in this mailing list. > > 1. What is the fundamental difference of APP versus PROJECT in Django > terminology. For instance, is it right to say, POSTS is an APP and > BLOG is a PROJECT or ORDERS is an APP and ORDER_MANAGEMENT is a PROJECT ..
One way to describe a "project" is "web site", or "web application". You have a top-level urls.py, a top-level settings.py, and in your settings you are specifying which "apps" are to be used in this site. An app, then, does NOT need to sit in the project directory. Instead, it can and should be a Python package and should be made available to your "project" via being on the PYTHONPATH. That way, the app is available to any other projects at the same time. For more on this structure, read James Bennett's _Practical Django Projects_, and his blog entries on the subject. > 2. Particularly, I don't like the idea of using a single models.py for > many entities, I would rather to keep separate files for each of > entity .. in a scenario like a huge team is working on a project, this > approach will create unnecessary noise. Any answers? As others have stated, feel free to break out models.py into ../models/__init__.py and ../models/<modelA.py>, ../models/<modelB.py>, etc. However, one major point to keep in mind is that if you restrict a given "app" to providing a single function (or small set of intimately related functions), and break other functionality into other apps, then the models.py for a given app will generally never get too terribly big. This separation and modularization is part of the success factor for Django -- there are hundreds, perhaps thousands of reusable apps you can plug in to provide functionality for your site. And when you start thinking that your models.py, or views.py, is getting too big, you should probably start asking yourself if you split a related set of functionality out into its own app. ---Peter Herndon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

