Django wsgi.py更改监视器在未进行更改时检测到更改

我正在Windows机器上开发基于django的站点,但是我将所做的更改推送到了无头的Ubuntu服务器上以进行登台。当我git将更改拉到登台服务器上的工作目录中时,我需要运行manage.py collectstatic。但是,当我这样做时,更改监视器(“重新加载源代码”的“监视代码更改”部分)报告它已检测到更改的文件:


monitor (pid=26216): Starting change monitor.


You have requested to collect static files at the destination

location as specified in your settings.


This will overwrite existing files!

Are you sure you want to do this?


Type 'yes' to continue, or 'no' to cancel: monitor (pid=26216): Change detected to 'myproject/manage.py'.

monitor (pid=26216): Triggering process restart.

Traceback (most recent call last):

  File "manage.py", line 10, in <module>

    execute_from_command_line(sys.argv)

  File "/envs/myproject/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 453, in execute_from_command_line

    utility.execute()

  File "/envs/myproject/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute

    self.fetch_command(subcommand).run_from_argv(self.argv)

  File "/envs/myproject/local/lib/python2.7/site-packages/django/core/management/base.py", line 222, in run_from_argv

    self.execute(*args, **options.__dict__)

  File "/envs/myproject/local/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute

    output = self.handle(*args, **options)

  File "/envs/myproject/local/lib/python2.7/site-packages/django/core/management/base.py", line 385, in handle

    return self.handle_noargs(**options)

  File "/envs/myproject/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 160, in handle_noargs

    % (destination_display, clear_display))

KeyboardInterrupt

我运行“ touch myproject / wsgi.py”以“更新更改缓存”,然后再次运行collectstatic命令。这导致了同样的错误。


然后,我进入python控制台并手动运行了监视启动命令:


import myproject.monitor

myproject.monitor.start(1)

这没什么区别。我还尝试向监视器添加条件,以便在检查文件更改时它会忽略manage.py,但这给了我同样的错误,因为myproject / __ init__.py是它报告为已更改的文件。有人知道是什么原因造成的吗?


跃然一笑
浏览 298回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python