I\'m writing a Django Middleware class that I want to execute only once at startup, to initialise some other arbritary code. I\'ve followed the very nice solution posted by
If it helps someone, in addition to pykler's answer, "--noreload" option prevents runserver from executing command on startup twice:
python manage.py runserver --noreload
But that command won't reload runserver after other code's changes as well.