Have just one base.html and static folder shared between all apps?


I need to have just one base.html template shared between all apps. What I’m thinking now is to have a “templates” folder under project, and put the base.html inside that.

For each app I’ll follow the standard method (appname/templates/appname).

But I don’t know how to put that into work.

Add your shared templates directory to the DIRS option of the TEMPLATES in your settings. This is in addition to setting APP_DIRS to True.

Thanks. It works properly.

Now, how to implement the same concept for static files? I want to have one static folder, not under any app, and shared with all apps.

I believe you are a looking for the STATICFILES_DIRS setting. https://docs.djangoproject.com/en/3.1/ref/settings/#staticfiles-dirs