Last active
February 1, 2018 13:00
-
-
Save lambdamusic/9d8ae96638353fea9e008ee0e36ab8c8 to your computer and use it in GitHub Desktop.
Django 1.8 static tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usual way | |
``` | |
<link href="{% static 'libs/bootswatch3.2/{{ THEME }}/bootstrap.min.css' %}" rel="stylesheet"> | |
``` | |
# more manual but works if you have variables in it | |
``` | |
<link href="{% get_static_prefix %}libs/bootswatch3.2/{{ THEME }}/bootstrap.min.css" rel="stylesheet"> | |
``` | |
See also: | |
https://stackoverflow.com/questions/16655851/django-1-5-how-to-use-variables-inside-static-tag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment