I’m relatively new to Django and am having difficulty laying out my project. Let’s say it’s for user-created movie reviews (it’s not). Here are the main components:
- A main site which is user-content driven. Users can browse and rate reviews and post new ones, etc.
- A mobile “browser-app” which is not just mobile-optimized stylesheets for the main site, but instead has different features. For example, it could be designed for quickly drafting a review while on the go.
- A basic API to support all the features of the browser-app (and more) for native mobile apps (iOS, Android, etc).
All these components share the same model, so it’s pretty clear that they belong in the same project. My question is, are the browser-app and API Django apps or sites?
It took me a few projects to fully grok the intended app/project layout (http://www.b-list.org/weblog/2006/sep/10/django-tips-laying-out-application/) but once I started following this pattern, everything became much simpler.
Each app should be a isolated concern though not necessarily fully independent. I’m not sure I’d create a project that had a “main” app and a “mobile” app. I’d rather segment based on concern such as: account mgmt, search, etc. And in each of those apps, I would expose urls specifically used for mobile.
It’s especially helpful for team development and managing migrations. If you just have one app and the team is generating multiple migrations in a sprint, it can become unwieldy to coordinate.
Hope this makes sense.