zpesk
zpesk

Reputation: 4353

How do I create site homepage in Django that integrates multiple apps?

So I have been following along with the Django Tutorial and have successfully created multiple "apps" that I now want to start integrating into a holistic website (which in Django seems to be called a project).

So here are my questions:

  1. How do I create a site homepage that is mostly static data (HTML, CSS, and images), but also includes data from some of the models of my projects?
  2. How do I link from this homepage to my apps? So if I have an app called "polls" (as in the demo), would linking to the polls page be as simple as linking to /polls?

Upvotes: 2

Views: 1905

Answers (1)

Torsten Engelbrecht
Torsten Engelbrecht

Reputation: 13496

  1. I think the general approach is that you also have to add one app which glues all your other apps together. So if you need a special homepage which somehow has to have full or part access to all the other apps you create an app for it and point for example your root url to this app.
  2. Following that (and depending if your other apps share data with each other or not) its really as simple as you said. The polls app could be accessible under /polls as an example, depending on how you configured it in your urlconf etc.

Upvotes: 2

Related Questions