我正在开发一个扩展,它将读取HTML元素值,然后对外部网站进行API调用,获取结果并将其显示在新创建的HTML元素中.
在本机chrome扩展与用户脚本中编写它的优点/缺点是什么?
我正在尝试在 heroku 上运行我的 django 应用程序。
文件夹结构:
app/
Procfile
docs/
...
project/
manage.py
wsgi.py
<django apps>
Run Code Online (Sandbox Code Playgroud)
配置文件
web: gunicorn --pythonpath="$PWD/project" wsgi:application --log-file=-
Run Code Online (Sandbox Code Playgroud)
我得到的错误:
2015-02-16T16:05:00.646316+00:00 heroku[web.1]: Starting process with command `gunicorn --pythonpath="$PWD/project" wsgi:application --log-file=-`
2015-02-16T16:05:02.697633+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Listening at: http://0.0.0.0:44846 (3)
2015-02-16T16:05:02.709567+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [9] [INFO] Booting worker with pid: 9
2015-02-16T16:05:02.696968+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Starting gunicorn 19.1.1
2015-02-16T16:05:02.697790+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] [3] [INFO] Using worker: sync
2015-02-16T16:05:02.793753+00:00 app[web.1]: [2015-02-16 16:05:02 +0000] …Run Code Online (Sandbox Code Playgroud) 我在Heroku上有一个celery任务,它连接到一个外部API并检索一些数据,存储在数据库中并重复几百次.非常快(在~10次循环之后)Heroku开始警告高内存使用率.有任何想法吗?
tasks.py
@app.task
def retrieve_details():
for p in PObj.objects.filter(some_condition=True):
p.fetch()
Run Code Online (Sandbox Code Playgroud)
models.py
def fetch(self):
v_data = self.service.getV(**dict(
Number=self.v.number
))
response = self.map_response(v_data)
for key in ["some_key","some_other_key",]:
setattr(self.v, key, response.get(key))
self.v.save()
Run Code Online (Sandbox Code Playgroud)
Heroky记录
2017-01-01 10:26:25.634
132 <45>1 2017-01-01T10:26:25.457411+00:00 heroku run.5891 - - Error R14 (Memory quota exceeded)
Go to the log: https://api.heroku.com/myapps/xxx@heroku.com/addons/logentries
You are receiving this email because your Logentries alarm "Memory quota exceeded"
has been triggered.
In context:
2017-01-01 10:26:25.568 131 <45>1 2017-01-01T10:26:25.457354+00:00 heroku run.5891 - - Process running mem=595M(116.2%)
2017-01-01 10:26:25.634 …Run Code Online (Sandbox Code Playgroud) (新手问题,抱歉 - 我刚刚开始使用 MongoDB)
我正在像这样连接到 heroku 上的 mongo:
self.connection = pymongo.Connection(MONGO_URL)
self.db = self.connection.app13805318
Run Code Online (Sandbox Code Playgroud)
是否有可能我在几个小时后尝试使用 self.db 并且无法读取它?我是否需要对连接进行某种保活或刷新?
我想介绍一个流程,我们已经在使用 allauth 并想尝试使其与 allauth 一起使用(可能会添加另一个包):
我正在尝试连接到我的EC2实例并收到以下错误.
命令我正在运行:ssh -v -i key.pem ubuntu @ [我的实例地址]
正如我在其他线程中看到的那样,我将密钥文件的权限更改为600,但这并没有解决问题.
输出我得到:
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to ec2-54-247-2-128.eu-west-1.compute.amazonaws.com [54.247.2.128] port 22.
debug1: Connection established.
debug1: identity file /Users/avimeir/.ssh/id_rsa type 1
debug1: identity file /Users/avimeir/.ssh/id_rsa-cert type -1
debug1: identity file /Users/avimeir/.ssh/id_dsa type -1
debug1: identity file /Users/avimeir/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: …Run Code Online (Sandbox Code Playgroud) django ×3
heroku ×3
python ×2
amazon-ec2 ×1
deployment ×1
django-wsgi ×1
mongodb ×1
tampermonkey ×1
userscripts ×1
wsgi ×1