我正在尝试运行我的python脚本,它使用django中定义的一些模型,然后在docker容器中。我使用以下命令:
sudo docker-compose -f production.yml run django python manage.py shell < send.py
但我一直收到这个错误:
IndentationError: unexpected indent
File "<console>", line 1
stats = grp_px.calc_stats(dropna=False)
^
IndentationError: unexpected indent
File "<console>", line 1
st = stats.render_perf(key=key)
^
IndentationError: unexpected indent
File "<console>", line 1
perf_list.append([key, st.render()])
^
IndentationError: unexpected indent
File "<console>", line 1
send_mail(html_message=render_to_string('fund_vs_peers.html', {'perf_list': perf_list}),
^
IndentationError: unexpected indent
File "<console>", line 1
message='',
^
基本上,我的每行代码都会出现缩进错误。有什么想法吗?