Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Django 1.8 static tips
# 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