Beego cannot find templatefile

just getting started, I selected a project from the official case and followed the documentation step by step, but kept prompting

can"t find templatefile in the path:views/admin/login.tpl

I am using beego version 1.10.1

:

ask for advice.
I guess it"s the routing problem.

May.26,2021

do not double-click your binaries, run your binaries
. / main


the information you give is not enough to determine the reason, according to my experience:
1. Is it true that the path is not written correctly? TplName should be user/user.html
2.


beego controller is output template by default, if you do not provide the corresponding template will report this error.
here should be that the login method in the admin controller does not provide a corresponding template.


found the answer to the question

https://github.com/astaxie/beego/issues/65

The
IDE tool compiles binaries to a temporary directory by default, such as when Win IDEA compiles:
"C:Program Files (x86) JetBrainsIntelliJ IDEA Community Edition 2016.3.3binrunnerw.exe" C:/Gobingo.exe build-o "C:UsersyouzhengchuanAppDataLocalTempBuild main.go and rungo" C:/Users/youzhengchuan/Documents/myGolangProject/src/myWebProject2/main.go

then, of course, the binary cannot find the index.tpl of the relative path. Modify the settings of the IDE tool. Select the compilation output directory as $GOPATH/src/$UBEEGOPROJECT/.

  • The problem of inputting uncertain parameters into go

    < H1 > question < H1 > when registering models using the beego framework, an error is reported: panic: <orm.RegisterModel> cannot use non-ptr model struct `.` if you look at the description, you should pass in the pointer, but I passed the poi...

    Mar.09,2021
  • Questions about data types in golang?

    as shown in the figure, the this.Ctx.Input.Param ( ": pag ") in the beego framework clearly returns string, but why does the error prompt say int? add: Thank you for answering, because this is often written in js and php, and I don t think ther...

    Apr.05,2021
  • Problems hidden in beego field

    { "Username":"", "Password":"" } but I need the ability to log in by the user, so the password submitted by the user cannot be verified. How to solve it? ...

    Mar.04,2022
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37b04-34463.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37b04-34463.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?