03 Ocak 2020 12:58

Muslu Y.

Django

Django unexpected token "indent" in file index.pug on line

Anasayfa

Django

Django unexpected token "indent" in file index.pug...

Django ile PUG (eski adı ile JADE) kullanırken aşağıdaki hatayı alıyorsanız sebebi kullandığınız | işaretinin indent den dışarıda olması yani boşluk hatası.

 

unexpected token "indent" in file index.pug on line
  Örnek Pug dosyası

    !!! 5 -load i18n
html(lang="{{ request.LANGUAGE_CODE }}")
    head
        meta(charset='utf-8')
        meta(name='viewport', content='width=device-width, initial-scale=1')
        meta(http-equiv='X-UA-Compatible', content='IE=edge')
        |
        |
        meta(name='description', content='Some description')
        title= "PyPugJS Test"
        |
        |
        link(rel='stylesheet', href='/static/site.css')
        script(src='https://code.jquery.com/jquery-3.4.1.min.js')
        |
        |
        script.
            var PugJS_status = {{PugJS|yesno:"true,false" }};
 
                if (PugJS_status) {
                    console.log("yes or no");
                }
    body
        h1.title PugJS
        #container
            if PugJS
                p Türkçe: {% trans 'Turkish' %}
            else
                p {% trans 'You have to try PugJS' %}
 
        h2 PugJS: {{ PugJS }}
 
 

Django

hakkında diğer konular

Makdos Bilişim Teknolojileri 2015 - 2025