Trying to display the current time


Hi all,

So I am trying to display the current time and date, and I suppose I am doing something right, because I don’t get any errors. The problem is… I don’t see what I want to see.

I have already searched for a solution, but nothing that I tried works.

Here’s my

from django.shortcuts import render
import datetime
# Create your views here.

def index(request):
    # new view
    return render(request, 'index.html')
    # current time and date
    terazData =

    # passing the current date to the template
    return render(request, 'index.html',{
        'data': terazData,

and here’s my index.html

{% extends 'base.html' %}
{% load staticfiles %}

<!doctype html>
<title>Strona Domowa - {{block.super}}</title>
<link rel="stylesheet" href="{% static 'css/style.css' %}" />
{% block content %}
	<h1>Hello World!</h1>
<p>I am a basic website.</p>
	{{ data|date:"D d M Y" }}
	{% endblock content %}


What is it that you want to see, and what are you actually seeing?