[dancer-users] Dancer2::Manual: confused as to use of 'appname' keyword to distribute code across packages
Amelia Ireland
aireland at lbl.gov
Fri Jul 15 22:39:49 BST 2016
Hello James,
Apologies for not filling out all the modules in the app.psgi file and
adding unnecessary confusion!
The response you're getting, not being able to locate the template file, is
usually due to a config error in setting the paths to the directory your
app looks in for template files. Have you tried debugging by printing out
the 'views' parameter (see
https://metacpan.org/pod/distribution/Dancer2/lib/Dancer2/Manual.pod#TEMPLATES
)?
You can also check that the endpoints you have defined are working
correctly by returning a text string; once that is verified, you know it's
just the template engine parameters that need altering.
On 15 July 2016 at 12:50, James E Keenan <jkeen at verizon.net> wrote:
> However, when I then went to the browser and issued a previously working
> API call, I got this error output:
>
> #####
> {"status":"500","title":"Error 500 - Internal Server
> Error","exception":"Failed to render template: file error - login.tt: not
> found at
> /home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Dancer2/Core/Role/Template.pm
> line 132.\n","message":""}
> #####
>
> In the server I got output like this:
> #####
> [mywebapp:3420] core @2016-07-15 15:45:55> looking for get /login in
> /home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Dancer2/Core/App.pm
> l. 840
> [mywebapp:3420] core @2016-07-15 15:45:55> Entering hook
> core.app.before_request in
> /home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Dancer2/Core/App.pm
> l. 840
> [mywebapp:3420] error @2016-07-15 15:45:55> Route exception: Failed to
> render template: file error - login.tt: not found at
> /home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Dancer2/Core/Role/Template.pm
> line 132. in
> /home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/Dancer2/Core/App.pm
> l. 840
> #####
>
> Needless to say, if I can't locate 'login.tt', I can't login and
> therefore can't make any of the other previously working API calls.
>
> I've spent more than 10 hours over several days trying to figure this out,
> and I'm beginning to lose hope that it will ever work. Or, more precisely,
> I'm beginning to think that the documentation in Dancer2::Manual is
> claiming that something will work which just will not do so.
>
> Thoughts?
>
> Thank you very much.
> Jim Keenan
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160715/5cbfb8ea/attachment.html>
More information about the dancer-users
mailing list