Django 'runserver' displays blank page. It returns the source code and shows no errors. This problem was not here the last time I opened VS Code

I am doing a CS50 Web Project and it worked just fine until today. Now when I run the command 'python3 manage.py runserver (any port I want)' it displays:

Just a blank page

Django shows no errors, the settings are fine.

the '/admin' page functions without issues and the page source code is shown without issues.

This is not a Jinja syntax problem as well, as I checked it was correct to.

It shows this blank screen no matter the URL I go too.

If I open a live server it 'works' in that it displays contents to me. For example:

Using this comand:

Live server VS command

It displays at least something close to the page:

'Live' display. !!! - I got also {% endblock %} at the end.

I tried:

Opening it with Live server, it displays contents, however, obviously, not what I need.

Chaning the settings, they are fine.

Chaning the port, that's not the issue.

Checking the Jinja syntax, that's not the issue.

Restarting VS code, no change (the last time, once again, had no issues regarding such problems).

What is interesting is that if I remove all the code from a template like 'index.html':

If all original code is removed

Still nothing.

However, if I really remove everything:

Removing all code

Then it displays. Not sure what to make of that.

I tried making migrations, does not work. I even deleted the whole sqlite3 db and re-created it.

Here are also the contents of URLS py and ane my 'index' in the views.py for reference.

Urls.py Index 1

Index 2

Layout.html:

    {% load static %}

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Social Network</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
        <link href="{% static 'network/styles.css' %}?20181209" rel="stylesheet">
        <script src="{% static 'network/network.js' %}"></script>        
    </head>
    <body>
        
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <a class="navbar-brand" href="{% url 'index' %}">Network</a>
          
            <div>
              <ul class="navbar-nav mr-auto">
                {% if user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'user' user.username  %}"><strong>{{ user.username }}</strong></a>
                    </li>
                {% endif %}
                <li class="nav-item">
                  <a class="nav-link" href="{% url 'index' %}">All Posts</a>
                </li>
                {% if user.is_authenticated %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'following_posts' %}">Following</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'logout' %}">Log Out</a>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'login' %}">Log In</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'register' %}">Register</a>
                    </li>
                {% endif %}
              </ul>
            </div>
          </nav>
        
        <div class="body">
            {% block body %}
            {% endblock %}
        </div>
    </body>
</html>

This sounds like a case of invalid html.

Your network/layout.html from which you are extending from is probably missing its doctype, or having some other invalid html.

See that it starts with:

<!DOCTYPE html>

Try to clear the browser cache too:

CTRL+F5
Back to Top