When using class-based views, many of them have default rule to automatically search a template so we don't need to specify it every time we use a class-based view.
But I can't find any article writes about how default naming is done.
What are the rules to define default template name?
You can give template name as model_viewtype.html
Example: if model name is Abcd
abcd_list.html
abcd_form.html
abcd_detail.html
And if you still face issues, the debugger will suggest you.
Well if you don't create template, debugger is telling you which template you need to create. So if you want try it one by one. Otherwise use template_name = 'example.html'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With