Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

django

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.

like image 800
Jarad Avatar asked Dec 08 '25 21:12

Jarad


1 Answers

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  
like image 171
Denis Avatar answered Dec 11 '25 10:12

Denis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!