0

将 Pyramid 项目部署到 dotcloud 的正确方法是什么?

wsgi.py 的内容:

import os, sys
from paste.deploy import loadapp
current_dir = os.path.dirname(__file__)
application = loadapp('config:production.ini', relative_to=current_dir)

我目前收到以下错误。

uWSGI Error
wsgi application not found
4

3 回答 3

2

这可能表示wsgi.py无法成功导入。

您可以检查以下内容:

  • 的输出dotcloud logs appname.servicename
  • 使用 登录服务dotcloud ssh appname.servicename,然后转到current目录,启动python并查看如果您尝试这样做会发生什么from wsgi import application

如果有帮助,这里有一个超级简单的 Pyramid 应用程序: https ://github.com/jpetazzo/pyramid-on-dotcloud

于 2011-10-06T22:28:38.703 回答
0

试试这个:

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'hellodjango.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

http://docs.dotcloud.com/tutorials/python/django/

于 2011-10-20T05:23:38.137 回答
0

我能够使用以下方法通过 uWSGI 错误错误:

import os
from paste.deploy import loadapp
current_dir = os.getcwd()
application = loadapp('config:production.ini', relative_to=current_dir)

我仍然有静态文件的路径问题,所以我改变了:

config.add_static_view('static', 'static', cache_max_age=3600)

config.add_static_view('<myapp>/static', 'static', cache_max_age=3600)
于 2012-03-01T14:56:50.777 回答