How to use render_template in custom app

Hi guyz,
I am unable to figure out where i have to put the html file to be accessible using render_template function in a custom app.
I am trying this way:
adding student_button.html in wit_educatio_app folder,
adding it in public\js folder of custom app.
and using this code.

frappe.render_template(“wit_education_app.student_button”, {
student: student.student,
student_name: student.student_name,
group_roll_number: student.group_roll_number,
status: student.status
})

But its not working please help.

Welcome to erpnext mtajammul

Check your logs for an error traceback or clues to what may not be working

frappe@erpnext:~/frappe-bench$ find logs -name ‘*.log’
logs/node-socketio.error.log
logs/redis-queue.error.log
logs/redis-socketio.log
logs/auto_update_log.log
logs/redis-cache.error.log
logs/node-socketio.log
logs/web.log
logs/worker.error.log
logs/redis-queue.log
logs/frappe.log
logs/redis-socketio.error.log
logs/schedule.error.log
logs/bench.log
logs/redis-cache.log
logs/web.error.log
logs/worker.log
logs/schedule.log

Thanks for your kind reply. But your solution is like finding a needle in a haystack.
I fallowed this post and found the solution:

https://discuss.frappe.io/t/build-json-and-custom-css/27138/2

Well done!

ok yes in that case, to search for ‘needle’ in the logs haystack this expression will find it - assuming it’s there!

frappe@ubuntu1804lts:~/frappe-bench$ find logs/ -name *.log | xargs grep 'needle'

Here’s a more real case

frappe@ubuntu1804lts:~/frappe-bench$ find logs/ -name *.log | xargs grep 'exception'
logs/node-socketio.error.log:    at _exceptionWithHostPort (util.js:1044:20)
logs/node-socketio.error.log:    at _exceptionWithHostPort (util.js:1044:20)
logs/worker.error.log:16:59:04 Worker rq:worker:ubuntu1804lts.29652.short: found an unhandled exception, quitting...
logs/worker.error.log:redis.exceptions.ConnectionError: Connection closed by server.
logs/worker.error.log:16:59:04 Worker rq:worker:ubuntu1804lts.29651.long: found an unhandled exception, quitting...
logs/worker.error.log:redis.exceptions.ConnectionError: Connection closed by server.
logs/worker.error.log:During handling of the above exception, another exception occurred:
logs/worker.error.log:redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.
logs/worker.error.log:16:59:04 Worker rq:worker:ubuntu1804lts.29650.default: found an unhandled exception, quitting...
logs/worker.error.log:redis.exceptions.ConnectionError: Connection closed by server.
logs/worker.error.log:During handling of the above exception, another exception occurred:
logs/worker.error.log:redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.
logs/worker.error.log:During handling of the above exception, another exception occurred:
logs/worker.error.log:redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.
logs/web.log:frappe.exceptions.AuthenticationError
logs/web.log:frappe.exceptions.AuthenticationError

:slight_smile:

1 Like