PyCharm Django {% block content %} does not work
Hello I am using:
PyCharm 2021.1 (Community Edition)
Build #PC-211.6693.115, built on April 6, 2021
Runtime version: 11.0.10+9-b1341.35 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2028M
Cores: 8
Non-Bundled Plugins: com.berzanmikaili.intellij.monokai_pro (2.0.2c), com.jetbrains.darkPurpleTheme (1.2), com.vecheslav.darculaDarkerTheme (1.2.0), in.thekalinga.snippet.intellij (6.1.0), tv.codely.codelytv-theme (2.1.2)
I am working on a Django project and use in the HTML files the extends.. my file look like these:
base.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
hello world
{% block content %}
{% endblock content %}
</body>
</html>
helloworld.html:
{% extends "base.html" %}
{% block content %}
test
{% endblock content %}
My problem is that the word "test" is not showing up. I tried to write a new project and try it again, without success..
And hints on what could be wrong?
Please sign in to leave a comment.
It doesn't look like a PyCharm-related problem as running your Django app outside of PyCharm will give the same result.
Btw, PyCharm Professional has proper support for Django so you may want to try it. There is a 30 days trial period.