Bruno Bollati
Bruno Bollati

Reputation: 35

TemplateSyntaxError with static django 2

I have this code:

HTML

{% load static %}
<!--[if lte IE 8]><script src="{% static game_reviews/css/ie/html5shiv.js %}"></script><![endif]-->

settings.py

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'game_reviews',]

STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',]

STATIC_URL = '/static/'

i had a folder inside my app called static/game_reviews, and inside have multiple folder (js, css, etc.).

and i getting this error :

TemplateSyntaxError at /game_reviews/

Could not parse the remainder: '/css/ie/html5shiv.js' from 'game_reviews/css/ie/html5shiv.js'

Any help?. Thanks in advance.

Upvotes: 0

Views: 51

Answers (1)

user8060120
user8060120

Reputation:

by the django static-files, you should send path as parameter:

{% load static %}
<!--[if lte IE 8]><script src="{% static "game_reviews/css/ie/html5shiv.js" %}"></script><![endif]-->
                                    <!-- ^^                                ^^-->

Upvotes: 3

Related Questions