librelist archives

« back to archive

problem with context processor

problem with context processor

From:
Sergej Felde
Date:
2011-12-22 @ 14:56
Hello!

I have a problem with the context processor.

Maybe someone can give me an answer why I do not see on the productive 
environment the output of the function. Locally, everything works 
wonderful.

Server Info:
- nginx with uwsgi
 

Thank you.

Sergej

#########
# code
#########

from time import gmtime, strftime

#context processor
@app.context_processor
def inject_year():
    return dict(c_year=strftime('%Y', gmtime()))


#in template
<span>© company {{c_year}}</span>

#########