How can I have a separate html_head.html file but still can override the title tag?

Below are my codes:

includes/html_head.html

<head>
    <title>{% block page_title %}{% endblock page_title %}</title>
</head>

base.html

<!DOCTYPE html>
<html lang="en">
{% include "includes/html_head.html" %}
  <body>
	<h1>Hello World!</h1>
  </body>
</html>

index.html

{% extends "base.html" %}
{% block page_title %}
    My Page Title
{% endblock page_title %}

How can I have a separate html_head.html file but still can override the title tag?

You cannot access {% block page_title %}{% endblock page_title %} in html_head.html because you didn’t extend it, instead you have it as an include. This is not possible.