Django Test Run Environment error: no enough space left on disk

Django Test Run Environment error: no enough space left on disk

我正在经历 Django tutorial, 我能够通过以下步骤执行 creating a project, database setup development server 步骤中提出的问题。

我在虚拟环境中试过(venv)$ python manage.py runserver

输出:

Performing system checks...

System check identified no issues (0 silenced).

January 14, 2015 - 09:39:53
Django version 1.7.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

[2015-01-14 09:39:54,347 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/auth/hashers.py WD=-1, Errno=No space left on device (ENOSPC)
[2015-01-14 09:39:54,348 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/test/__init__.py WD=-1, Errno=No space left on device (ENOSPC)

检查我的分区盘是否用完了space我试过了

(venv) $ df

输出:

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda1      236182272 56881792 167280052  26% /
none                   4        0         4   0% /sys/fs/cgroup
udev             1969912        4   1969908   1% /dev
tmpfs             397084     1480    395604   1% /run
none                5120        0      5120   0% /run/lock
none             1985416     3048   1982368   1% /run/shm
none              102400       28    102372   1% /run/user

我可以清楚地看到可用部分中几乎没有免费 space。

有没有人在尝试在 Django 中运行服务器时遇到过这个错误。

我试过了

$virtualenv-3.4 -p /usr/bin/python3.4 venv 
Running virtualenv with interpreter /usr/bin/python3.4
Using base prefix '/usr'
New python executable in venv/bin/python3.4
Also creating executable in venv/bin/python
Installing setuptools, pip...done.

工作目录

$ source venv/bin/activate

我又安装了 Django。

(venv)$ python manage.py runserver
       Performing system checks...

System check identified no issues (0 silenced).
January 15, 2015 - 18:56:44
Django version 1.7.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

非常简洁,没有 PyNotify 错误

你可以试试this link.

基本上对我有用的是我使用了前 3 个命令:

sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

然后我重新启动了我的开发服务器,但我没有看到错误。

您可能已达到您的手表配额。

找到您的当前限制,请在您的终端中输入:

cat /proc/sys/fs/inotify/max_user_watches

默认情况下通常为 8192。

提高限额,请键入:

sudo sysctl fs.inotify.max_user_watches=16384

然后重启django。

永久设置此限制,请键入:

echo 16384 | sudo tee -a /proc/sys/fs/inotify/max_user_watches

有一个非常详细的答案,您可以在此处找到更多信息:https://unix.stackexchange.com/a/13757/79648