2011-10-02 82 views
0

将金字塔项目部署到dotcloud的正确方法是什么?将金字塔部署到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 

回答

0

我是能够得到使用通过uWSGI Error错误:

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) 
2

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

您可以检查以下内容:

输出
  • dotcloud logs appname.servicename
  • dotcloud ssh appname.servicename服务日志,然后去current目录,启动python看看会发生什么,如果你尝试做from wsgi import application

如果可以帮助,这里是一个超级简单的金字塔应用程序: https://github.com/jpetazzo/pyramid-on-dotcloud

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/

+0

ooops。我认为这不是你正在寻找的答案。抱歉。我没有注意。干杯! –