我正在尝试在 NGINX 和 uWSGI 后面运行 Django 应用程序,但是datetime.today()从今天开始安装 uWSGI 服务器时返回日期时间时遇到问题。该应用程序的配置如下:
<uwsgi>
<plugin>python</plugin>
<socket>127.0.0.1:3030</socket>
<chdir>/opt/ETS/bin</chdir>
<pythonpath>..</pythonpath>
<模块>实例</模块>
</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"),
它在使用 Apache WSGI 托管在同一台服务器上时工作