django 错误问题

(1)ubuntu上运行的django出现No space left on device错误

运行django出现错误信息:

[2016-12-24 14:33:24,476 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/cache.py WD=-1, Errno=No space left on device (ENOSPC) ERROR:pyinotify:add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/cache.py
WD=-1, Errno=No space left on device (ENOSPC)

查询网络第一判断是缺少Inode节点: linux中创建一个文件不仅仅需要存储空间,也需要Inode节点。Inode节点在磁盘建立的时候就分配好最大的个数(每2K空间分配一个节点),一般情况下这个数目是够用的,但是如果磁盘拥有大量小文件(小于2k),就能将Inode节点用完。

查看存储空间

$df -h

查看i节点

$df -i

看是那种情况。

不幸的是我哪种都不是,后来在stackflow找到了答案。

 

问题原因:You may have reached your quota of watches.

 

解决办法:

查看目前的最大值

To find your current limit, type this in your terminal:

cat /proc/sys/fs/inotify/max_user_watches

增加最大值

Which is typically 8192 by default.

To increase your limit, type this:

sudo sysctl fs.inotify.max_user_watches=16384

永久设置最大值

Then restart django.

To permanently set this limit, type this:

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

时间: 2024-07-28 16:05:00

django 错误问题的相关文章

ubuntu+阿里云搭建django网站,但是部署上去出现错误

问题描述 ubuntu+阿里云搭建django网站,但是部署上去出现错误 阿里云搭建django网站,域名和公网ip都买了并绑定且备案了,网站写好了,但是部署上去出现错误 Not Found The requested URL /educationma/search was not found on this server. Apache/2.4.7 (Ubuntu) Server at Port 80 哪位朋友知道该怎么办嘛?十分感谢 解决方案 在阿里云的控制面板上,申请客服,填写工单和联系电

apace-ubuntu+django+mod_wsgi+apache部署网站,报下面的错误

问题描述 ubuntu+django+mod_wsgi+apache部署网站,报下面的错误 [Tue Jul 08 16:07:47.983174 2014] [mpm_event:notice] [pid 5054:tid 140062636054400] AH00491: caught SIGTERM, shutting down [Tue Jul 08 16:07:49.046666 2014] [mpm_event:notice] [pid 5211:tid 13988251035020

django中使用jquery ajax post数据出现403错误的解决办法(两种方法)_AJAX相关

在django中,使用jquery ajax post数据,会出现403的错误 方法一: 如果用jQuery来处理ajax的话,Django直接送了一段解决问题的代码.把它放在一个独立的js文件中,在html页面中都引入即可.注意这个js文件必须在jquery的js文件引入之后,再引入即可 $(document).ajaxSend(function(event, xhr, settings) { function getCookie(name) { var cookieValue = null;

django使用ajax post数据出现403错误如何解决_AJAX相关

本文通过两种方法给大家介绍在django中,使用jquery ajax post数据,会出现403的错误,具体内容请看下文. 方法一: 如果用jQuery来处理ajax的话,Django直接送了一段解决问题的代码.把它放在一个独立的js文件中,在html页面中都引入即可.注意这个js文件必须在jquery的js文件引入之后,再引入即可 $(document).ajaxSend(function(event, xhr, settings) { function getCookie(name) {

django访问静态资源css, js, 图片报编码错误解决办法

错误截图如下 可以发现所有的静态资源文件,包括css, js, 图片文件都找不到,后台错误报编码错误. 试过很多办法,包括在settings.py 中设置 DEFATULT_CHARSET='UTF-8' 等,也还试过有人说过的,在manage.py 中加入下面的语句: 程序代码 程序代码  代码如下 复制代码 reload = reload(sys) sys.setdefaultencoding("cp1251") #其实这里还会报错,貌似python2.7 不支持 setdefau

django使用ajax post数据出现403错误如何解决

本文通过两种方法给大家介绍在django中,使用jquery ajax post数据,会出现403的错误,具体内容请看下文. 方法一: 如果用jQuery来处理ajax的话,Django直接送了一段解决问题的代码.把它放在一个独立的js文件中,在html页面中都引入即可.注意这个js文件必须在jquery的js文件引入之后,再引入即可 $(document).ajaxSend(function(event, xhr, settings) { function getCookie(name) {

django中使用jquery ajax post数据出现403错误的解决办法(两种方法)

在django中,使用jquery ajax post数据,会出现403的错误 方法一: 如果用jQuery来处理ajax的话,Django直接送了一段解决问题的代码.把它放在一个独立的js文件中,在html页面中都引入即可.注意这个js文件必须在jquery的js文件引入之后,再引入即可 $(document).ajaxSend(function(event, xhr, settings) { function getCookie(name) { var cookieValue = null;

Django 403错误:CSRF verification failed. Request aborted

网上有解决办法,我自己的组合是: 一,FORM加标识 <form action="" method="post"> {% csrf_token %} 类型:<select name="salt_class"> 二,VIEW导入Redirect from django.http import HttpResponsefrom django.http import HttpResponseRedirectfrom django

django --fields.E304 错误解决方案

今天在同一个表里,有多个不同的用户集时出现. fields.E304: Field name <field name> clashes with accessor for <fieldname>. 网上解决方案,增加不同的related_name解决. http://blog.csdn.net/meylovezn/article/details/46924893 related_name will be a unique column in db table, so a model