尝试在Docker中的Django中运行python脚本

我试图运行我的python脚本,它使用了一些在docker容器中的django里面定义的模型。 我使用以下命令:

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='', ^ 

基本上,我的代码的每一行都有一个缩进错误。 有任何想法吗?