Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Last active February 1, 2018 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/9d8ae96638353fea9e008ee0e36ab8c8 to your computer and use it in GitHub Desktop.
Save lambdamusic/9d8ae96638353fea9e008ee0e36ab8c8 to your computer and use it in GitHub Desktop.
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