TemplateSyntaxError in Django at /admin/login (default requires 2 arguments, 1 provided)

后端 未结 1 846
孤街浪徒
孤街浪徒 2021-01-29 06:42

I looked thoroughly into my files and I could not find one error. Staring and reading my files for 45 minutes was a pain. I now need someone\'s help, I can\'t do this

th

1条回答
  •  无人及你
    2021-01-29 07:11

    Your login template has a syntax error as you did not escape the apostrophe (') in your string literal. Change the following

    {{ site_header|default:('Kweli's webby') }}
    

    to

    {{ site_header|default:_("Kweli's webby") }}
    

    Also note the underscore (_) before the string argument which is used for localization. If you don't need multiple languages, you can get rid of parantheses and simply write

    {{ site_header|default:"Kweli's webby" }}
    

    0 讨论(0)
提交回复
热议问题