我试图在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) }
Run Code Online (Sandbox Code Playgroud)
来自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托管在同一服务器上时起作用