Opened 10 years ago

Closed 10 years ago

#7265 closed (fixed)

Add timestamp output to runserver when "Validating models..."

Reported by: Valera Grishin Owned by: nobody
Component: Tools Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This is simple improvement to the Django development server available through " runserver" command. The goal is to add output of current time to the string "Validating models..."

So the proposition is to change this:

# django/core/management/commands/

            print "Validating models..."

To this:

# django/core/management/commands/

            print "[%s] Validating models..." % str([11:19]

This will cause the output:

Validating models...

to to be similar to this:

[21:30:42] Validating models...

Obviously you need to import datetime at the top of file (not shown in the example above). Full patch is attached.

Attachments (1)

current_time_at_validating.patch (792 bytes) - added by Valera Grishin <valery.grishin@…> 10 years ago.
Patch for django/core/management/commands/

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Valera Grishin <valery.grishin@…>

Patch for django/core/management/commands/

comment:1 Changed 10 years ago by James Bennett

What problem does this solve that can't be solved in other ways?

comment:2 in reply to:  1 Changed 10 years ago by anonymous

Replying to ubernostrum:

What problem does this solve that can't be solved in other ways?

This let's you see whether development server has reloaded after certain file has been changed.

Development server monitors the source files for the changes and reloads if any file has changed (i.e. saved in the editor). Reason for change is that server don't reload always. This is not the bug of the development server but rather changing the file that isn't monitored for certain reason.

Now assume you've edited and saved few source files in a row. Than you switch to development server console to check whether it reloaded. The timestamp near "Validating models..." will tell you exactly whether server has reloaded right now or you just seeing some former reloads (assume here you didn't request any pages in between the saves and reloads).

I've tried to find the way to the timestamp without touching the Django source codes but didn't succeeded.

comment:3 Changed 10 years ago by anonymous

In your file, put

import datetime
print str(

The settings file is reloaded every time the server restarts, so this will print the current day and time whenever the dev server restarts.

comment:4 Changed 10 years ago by Valera Grishin

Resolution: fixed
Status: newclosed

Thanks for the idea! Though it is better to put this output into the instead of because the latter gets loaded more then once.
I'm closing the ticket.

Note: See TracTickets for help on using tickets.
Back to Top