Jarad
Jarad

Reputation: 18923

Where should a Django homepage template and view exist in a large-scale project?

On a large-scale Django project, where should the homepage template and view exist within the project structure?

In its own app (ex: homepage app)?

Some other app (ex: accounts)?

At the project-level putting the template in a "templates" directory and the view somewhere?

Somewhere else?

Is there a most frequent answer to this question?

Definitions:

  1. Large-scale is defined as let's say 15 apps
  2. The homepage content is mostly static now, with plans to get more dynamic as the project evolves

Assumption: project structure strategy is dependent on the size of the project.

Upvotes: 3

Views: 1141

Answers (1)

Denis
Denis

Reputation: 7343

The best approach in my opinion implement everything as separate app because of code re-use. You can create app called "landing" with templates folder inside with nested "landing" directory what's how Django might find you templates automatically from GenericViews for example.

yourproject/
    landing/
         templates/
             landing/
                 index.html
        urls.py
        models.py
        views.py  

Upvotes: 2

Related Questions