Structure of apps within an example website

Hi

I am just starting out and I have a question to which I could not find the answer in the tutorials or on Google:

Say you are writing a website, like for example Facebook (I am not writing Facebook but it’s something everyone will know so it’s a good example).

What does the ideal structure look like of its apps?

Here is my idea:

  • First, start a new project called facebook.

  • facebook will need the following basic features: login/logout, sign up, posting. Each one corresponds to a view. Then there is also a like button. I am not clear on whether it should be an app.

  • It will also need a landing page, like the homepage view that you land on before you have an account. I suppose this landing view contains login and sign up as subviews.

Is it therefore perfect / ideal / in the spirit of django if I’d structure it as follows:

a login/logout app
a sign up app
a post app

And no app for the landing page? Or should there be a landing app?
Should sign up and login be one app? And a separate app for likes?

More generally speaking, how do I determine if I should make an app for some feature or not?

To clarify: In the tutorial the polls app contains the langing page (index.html). This suggests to me that I mustn’t have an index.html / landing page in the project that is not inside an app. Right?

Thank you for your feedback.

There was a popular discussion on this last year: Why do we need apps?

My advice is to use a single app for as long as possible. It makes migrations and other model changes easy. For example, Sentry has been running for many years with this model, and you can see the source for its one app here: https://github.com/getsentry/sentry/tree/master/src/sentry

2 Likes

Thank you for your help. There was also a link to the same question on stackoverflow. It looks like it’s fine to do a project containing just one app.