NGINXとuWSGIの背後でDjangoアプリケーションを実行しようとしていdatetime.today()
ますが、uWSGIサーバーが今日の代わりに起動されたときから日時を返すのに問題があります。アプリの構成は次のとおりです。
<uwsgi> <plugin> python </ plugin> <socket> 127.0.0.1:3030 </ socket> <chdir> / opt / ETS / bin </ chdir> <pythonpath> .. </ pythonpath> <module> instance </ module> </ uwsgi>
uWSGIの設定は、変更なしのデフォルトです。
日時を再び機能させるにはどうすればよいですか?
明確化:URLへのアクセス時にこの関数で呼び出しが行われます
def create_file_header(name, ext):
return {'Content-Disposition': 'attachment; filename=%s-%s.%s' % (name, datetime.date.today(), ext) }
呼び出しはurlpattenからです:
(r'^ Loading_details / basic2 / $'、ExpandedResource(ReadLoadingDetailHandler、authentication = authentication、 headers = create_file_header('loading-details'、'csv'))、 FORMAT_CSV、 "api_loading_details_basic_auth")、
ApacheWSGIを使用して同じサーバーでホストされている場合に機能しました