[Django]-Name Error: global name 'loader' is not defined

5👍

use this code

    template = get_template("news.html") 

instaed of

    template = loader.get_template("news.html")

Your problem will be solved.Because you have already impotred function get_template so need to use loader.get_template

👤Aks

Leave a comment