Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

views not working #23

Open
c0ze opened this issue Jan 6, 2019 · 6 comments
Open

views not working #23

c0ze opened this issue Jan 6, 2019 · 6 comments

Comments

@c0ze
Copy link

c0ze commented Jan 6, 2019

I just imported this and trying login / logout etc. I get

failed to find template: auth/login

I'm using go1.11.1, deps installed with modules.

I also tried installing the clean theme, but didnt help.

@rogerkirkness
Copy link

I had to copy the views over from the Qor project into my local app.

(root of project)/app/views/qor/*

Where * is the equivalent views folder from the auth app.

@sergolius
Copy link

@c0ze
Looks like by default QOR expects to be used without any dependency management (GOPATH only), because of default view paths.
In some cases it could be used with dependency management tool which copies/vendors repo as it's

go modules
https://tip.golang.org/cmd/go/#hdr-Make_vendored_copy_of_dependencies
go mod vendor - it doesn't copy asserts/vendor files like .html, .tmpl
To make QOR works with go modules you have to collect used/needed views (as mentioned #23 (comment)) and register on configuration stage.

See documentation, https://github.com/qor/render and it source code.

@siredwin
Copy link

I wish I had seen this earlier when I was dockerizing this. But it is true. It needs GOPATH. Even docker images need to be Golang images, not just any Linux images. As far as I know, Glide and Go Modules would not work for me.

@sergolius
Copy link

@siredwin no, alpine image is enough.
As I described above assets/static files are ignored, as solution you can collect all of them and register over default assets paths.
Solution 1:
You have to add image binary file(build result) and collected assets to the image. Keep in mind that you have to keep structure of assets same as it's in project.
Solution 2:
Use bindatafs to have assets added to binary file.
qor/admin#210 (comment)

@siredwin
Copy link

@sergolius, you are right. I assumed it needed GOPATH because of the exact nature of the paths. Indeed any Linux Image can work. It works. I am using solution 1 because I like to update the binary only on my programs.

@ondbyte
Copy link

ondbyte commented Jul 12, 2022

any help regarding this, I'm coming from a frontend framework.
I want to setup a small website with authentication using qor.
as a initial step i am trying to add authentication to admin, but it says failed to find template: auth/login do i need to run anything before running the qor app? If Icollect all the views in a single folder like the comment above mentioned, labels in the html shows default place holders in the templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants