[Django]-How to get rid of "%20" code in URLs (django)

5👍

I believe the template engine is doing what you are asking it to do.

href="{{STATIC_URL}} /stati/css/default.css"

correctly translates to

/static/ /stati/css/default.css

Try

href="{{STATIC_URL}}css/default.css"

in base.html if what you are after is

/static/css/default.css

Can’t account for why home.html would work correctly though.

2👍

It looks to me like you added the spaces manually to base.html:

<link rel="stylesheet" type="text/css" href="{{STATIC_URL}} /stati/css/defau...
<img alt="logo2:" src="{{ STATIC_URL }} /static/imag....

Take out the space before /stati/css and /static/imag and see if the problem goes away.

0👍

space = %20. Be sure to omit space from your url…

like : <script src="{% static " js/dashboard/salesPieChart.js" %}"></script>
To: <script src="{% static "js/dashboard/salesPieChart.js" %}"></script>

Leave a comment