Hi monks,

So, after some tinkering I realsied that it actaully wasn't too hard to get my sessions into a postgresql database using Dancer2:Session:DBIC. I'm having an issue with my config.yml though, this is what I've got in my file at present:

appname: "xxxx" layout: "main" charset: "UTF-8" template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>' session: "DBIC" engines: session: DBIC: dsn: "dbi:Pg:database=xxxx" schema_class: "xxxx::Schema" user: "" password: "" # resultset: "Session" id_column: "id" data_column: "data"
This breaks template toolkit and I just get <% content %> where the HTML should be. If I replace the template toolkit block above with template: "template_toolkit" (uses the default tags [% %]) it works fine.

If I leave the template toolkit block as it is above and remove the session config block completely template toolkit works properly (with <% %> tags). I've tried swapping the config blocks around so that TT is after session, that gives me an Unable to create a new session: No schema class defined error. I've also tried playing around with the yaml formatting/spacing but I can't get them to play nicely. Can anyone spot what I'm doing wrong?


In reply to Dancer 2 yaml config file by soundX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.