[Answered ]-Django/Apache old content after restart

2👍

Your problem is here:

def index(request, starttime = datetime.now(), version = False):

There starttime is evaluated when the method is defined, which happens when the module is first imported – in other words, when the server is restarted. Don’t put values there; instead, leave the default as None and check in the function itself:

def index(request, starttime=None, version = False):
    if starttime is None:
        starttime = datetime.now()

Leave a comment