Issue
I want to add CSS and Js file path into header and footer for load CSS and js files for web template but I'm getting this error.
I load {% load static %}
TemplateSyntaxError at / Could not parse the remainder: '/css/bootstrap.min.css' from 'front/css/bootstrap.min.css' Request Method: GET Django Version: 3.0.2 Exception Type: TemplateSyntaxError
<link rel="stylesheet" type="text/css" href="{% static front/css/bootstrap.min.css %}">
<link rel="stylesheet" type="text/css" href="{% static front/css/font-awesome.css %}">
<link rel="stylesheet" type="text/css" href="{% static front/js/plugins/swiper/swiper.css %}">
<link rel="stylesheet" type="text/css" href="{% static front/js/plugins/magnific/magnific-popup.css %}">
<link rel="stylesheet" type="text/css" href="{% static front/css/style.css %}">
Solution
Change the code to
<link rel="stylesheet" type="text/css" href="{% static 'front/css/bootstrap.min.css' %}">
note: if you use double quotes outside brackets use single quote inside
Answered By - bmons
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.