Django-staticfiles-google-code-prettify je aplikace Django snadno patří satelitní-code-prettify ve vašich Django aplikace.
Instalace
Nainstalujte tento balíček pomocí PIP
& Nbsp; pip nainstalovat Django-staticfiles-google-code-prettify
Ujistěte se, že Django projekt je nakonfigurován pro použití staticfiles, pak přidat na vaše INSTALLED_APPPS
& Nbsp; INSTALLED_APPS + = ['Django-staticfiles-google-code-prettify "]
Použít
Můžete použít dvěma různými způsoby v šablonách.
STATIC_URL
& Nbsp; & lt; link href = "{{}} STATIC_URL google-code-prettify / css / prettify.css" type = "text / css" rel = "stylesheet" / & gt; & Lt; script type = "text / javascript" src = "{{}} STATIC_URL google-code-prettify / js / prettify.js" & gt; & lt; / Script & gt;
statické šablony tag
& Nbsp; {% zatížení statické z staticfiles%} & lt; link href = "{% static" google-code-prettify / css / prettify.css "%}" type = "text / css" rel = "stylesheet" / & gt; & Lt; script type = "text / javascript" src = "{% static" google-code-prettify / js / prettify.js "%}" & gt; & lt; / Script & gt;
Požadavky na :
- Python
- Django
Komentáře nebyl nalezen