django-staticfiles-google-code-FÖRSKÖNA är en Django app för att enkelt inkludera google-code-prettify i dina Django appar.
Installation
Installera detta paket med hjälp pip
& Nbsp; pip installera django-staticfiles-google-code-prettify
Se till att din django projektet är konfigurerad att använda staticfiles, sedan lägga detta till dina INSTALLED_APPPS
& Nbsp; INSTALLED_APPS + = ['django-staticfiles-google-code-FÖRSKÖNA ",]
Användning
Du kan använda detta på två olika sätt i dina mallar.
STATIC_URL
& Nbsp; & lt; link href = "{{STATIC_URL}} google-code-FÖRSKÖNA / css / prettify.css" type = "text / css" rel = "stylesheet" / & gt; & Lt; script type = "text / javascript" src = "{{STATIC_URL}} google-code-FÖRSKÖNA / js / prettify.js" & gt; & lt; / Script & gt;
statisk mall tagg
& Nbsp; {% belastning statiskt från staticfiles%} & lt; link href = "{% statiskt" google-code-FÖRSKÖNA / css / prettify.css "%}" type = "text / css" rel = "stylesheet" / & gt; & Lt; script type = "text / javascript" src = "{% statiskt" google-code-FÖRSKÖNA / js / prettify.js "%}" & gt; & lt; / Script & gt;
Krav :
- Python
- Django
Kommentarer hittades inte