After completing the Django tutorial, I was a little confused as to how one is supposed to structure the homepage for a web application containing multiple applications.
There seem to be three common approaches:
- Flatpages – https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/
- Create a separate dedicated app
- Create a new views.py in the “project” folder which contains your settings.py
Flatpages are static content pages which are saved in the database backing your Django application. This makes creating a homepage very easy, but also – by definition – static. This is probably most useful for things like an “About Us” page. A homepage will surely have dynamic content (e.g. latest news).
I opted to create a views.py in my project folder for now. If this doesn’t work, I will look at creating a “general” application that fills the gaps between the specific dedicated apps.