Override templates of external app in Django

前端 未结 2 497
忘掉有多难
忘掉有多难 2021-01-04 14:38

I want to override the templates of an external app (allauth, installed in site packages). Unfortunately no advice i read worked. I added the following to my settings.

2条回答
  •  余生分开走
    2021-01-04 14:41

    The way I tend to figure out what's going on (with DEBUG set to True), is to have a view render a template that didn't exist, and look at the list of locations Django tried to load templates from (which will be included in the error page output).

    What templates are the views trying to render? If they're trying to render allauth/foo.html, then you'll want to add my_project_dir/templates to your TEMPLATE_DIRS setting, not my_project_dir/templates/allauth.

提交回复
热议问题