我感兴趣的是定期按时间间隔运行某些操作.显然,这是cron的任务,对吧?
不幸的是,互联网似乎在那里存在一些分歧.
让我详细说明一下我的设置.首先,我的开发环境是在Windows中,而我的生产环境是在Webfaction(Linux)上托管的.Windows上没有真正的cron,对吧?另外,我使用Django!还有什么建议Django?
芹菜当然!不幸的是,设置Celery对我来说或多或少是一个字面上的噩梦 - 请参阅错误信息'使用Celery可以找到记录器"多处理"的处理程序.这只是我和Celery一起遇到的问题之一.其他包括套接字错误,我是唯一一个遇到问题的人.
别误会我的意思,芹菜似乎真的很酷.不幸的是,似乎缺乏支持,并且在其首选后端RabbitMQ中内置了一些奇怪的限制.不幸的是,无论程序有多酷,如果它不起作用,那么它不起作用!
这就是我希望你们所有人都能进来的地方.我想了解cron或者cron-equivalent,它们可以在Windows和Linux环境中以类似方式(最好是相同的)进行设置.
(我现在已经和Celery挣扎了大约两个星期,不幸的是我认为现在是时候抛弃它并放弃它,至少目前是这样.)
我正在尝试关注nodetuts.com的第3集.另外,我使用的是最新的(不稳定)版本的node - node.exe,版本0.5.2.这是我的代码,我几乎整天都在用这个错误撞墙.它只是一个窗户的东西?
var http = require('http');
var fs = require('fs');
var file_path = __dirname + '\\me.jpg';
console.log('serving: '+file_path);
fs.stat(file_path, function(err, stat){
if (err) throw err;
http.createServer(function(request,response){
response.writeHead(200, {
'Content-Type':'image/jpeg'
});
fs.readFile(file_path, function(err, file_content){
response.write(file_content);
response.end();
});
}).listen(8000);
})
Run Code Online (Sandbox Code Playgroud)
谢谢!
我对使用Django制作实时网络应用非常感兴趣.不幸的是,我在设置方面遇到了一些问题.我正在考虑的一些选择:
Orbited:似乎是Django的选择.不幸的是,他们的域名似乎已经过期,并且几乎所有我需要的文档才能使其正常运行.我已经按照http://mischneider.net/?p=125上的教程进行了操作,但是我遇到了一个神秘的错误(请参阅记录器"stomp.py"找不到处理程序).
流星:我不得不说,他们的网站给我留下了深刻的印象.不幸的是,我正在运行Windows,似乎缺乏关于Windows的任何文档.所以我迷路了.
Cometd:类似的问题:只是不明白安装.
龙卷风:需要pycurl,这反过来需要卷曲.继续抛出CURL_DIR然后libcurl.lib的问题.经过数小时的修补,有效地挫败了我的双手.
请帮忙.在这一点上我非常愿意考虑,好吧,任何事情.好吧,至少如果它记录在一起,我可以弄清楚如何安装它并与Django一起使用它.
任何帮助赞赏.
我希望这是一个很好的第一个问题.我一直试图干掉我的Django代码,但不幸的是我一直遇到了几个错误!(请原谅我,如果我不发布有问题的代码 - 我会发布有效的代码)我尝试使用@decorators,并在视图中放置视图.请帮我!
from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404
from blog.models import Post, User, Blog, Comment
from blog.forms import CommentForm, PostForm, BlogForm
from django.core.urlresolvers import reverse
import datetime
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django import forms
def limiter(request):
if not request.user.is_authenticated():
return HttpResponseRedirect(reverse('accounts.views.login_view'))
def postindex(request):
posts = get_list_or_404(Post.objects.all())
return render_to_response('index.html', {'posts':posts})
def onepost(request, postid):
post = get_object_or_404(Post, pk=postid)
if request.method == 'POST':
if not request.user.is_authenticated():
return HttpResponseRedirect(reverse('accounts.views.login_view'))
form = CommentForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
c …Run Code Online (Sandbox Code Playgroud) 我试图让Orbited开始,但不幸的是我遇到了不止一些问题!首先,easy_install的问题(已解决).然后,继续http://mischneider.net/?p=125的说明.但在使用时,orbited -c orbited.cnf我得到以下内容:
Traceback (most recent call last):
File "C:\Python27\Scripts\orbited-script.py", line 8, in <module>
load_entry_point('orbited==0.7.11beta3', 'console_scripts', 'orbited')()
File "C:\Python27\lib\site-packages\orbited-0.7.11beta3-py2.7.egg\orbited\star
t.py", line 133, in main
logging.config.fileConfig(options.config)
File "C:\Python27\lib\logging\config.py", line 70, in fileConfig
formatters = _create_formatters(cp)
File "C:\Python27\lib\logging\config.py", line 106, in _create_formatters
flist = cp.get("formatters", "keys")
File "C:\Python27\lib\ConfigParser.py", line 567, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'formatters'
Run Code Online (Sandbox Code Playgroud)
这是我的配置文件(orbited.cnf):
[listen]
http://:9000
stomp://:61613
[access]
* -> localhost:61613
[global]
session.ping_interval = 300
Run Code Online (Sandbox Code Playgroud)
(编辑:我可能需要一个[格式]部分?)我什么都没有,我发现大部分资源都指向orbited.org,因为我对轨道感兴趣的那一天就已经失败了.请帮帮我!我真的想开始使用酷炫的django应用程序!
我相信这很容易解决.我正试图调用slowbie.tick();
这是代码:
function slowbie(){ //Enemy that slowly moves towards you.
this.max = 7;
this.w = 25;
this.h = 25;
this.speed = 5;
this.points = 1;
this.enemies = [];
function spawn(){
if(this.enemies < this.max){
for (var i = this.enemies.length; i < this.max; i++) {
this.x = width + Math.floor(Math.random()*20) + this.w;
this.y = Math.floor(Math.random()*(height-this.h));
this.speed = Math.floor(Math.random()*(speed-1))+1;
this.enemies.push(
[this.x, this.y, this.w, this.h, this.speed]);
}
}
}
function move(){
for (var i = 0; i < this.enemies.length; i++) {
if (this.enemies[i][0] …Run Code Online (Sandbox Code Playgroud) 我对以下3个命令中的每一个都得到了相同的错误.是来自ifconfig的我的ip地址.什么是错误的任何想法?昨晚工作得很好.
mpiexec -f machinefile -n <number> hostname
mpiexec -f machinefile –n 1 hostname
mpiexec -f machinefile -n 2 ~/mpich_build/examples/cpi
--------------------------------------------------------------------------
mpiexec was unable to launch the specified application as it could not find an executable:
Executable: -f
Node: raspberrypi
while attempting to start process rank 0.
--------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
我正在按照http://www.southampton.ac.uk/~sjc/raspberrypi/pi_supercomputer_southampton.htm的教程进行操作
django ×4
python ×3
comet ×2
javascript ×2
cron ×1
django-views ×1
linux ×1
mpi ×1
mpiexec ×1
node.js ×1
orbited ×1
raspberry-pi ×1
stomp ×1
typeerror ×1
windows ×1