开发者

Deploying Pyramid to dotcloud

What is the proper way to deploy a Pyramid project to dotcloud?

The contents of 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)

I'm currently getting the following error.

uWSGI Error开发者_运维知识库
wsgi application not found


This could indicate that wsgi.py could not be imported successfully.

You can check the following:

  • output of dotcloud logs appname.servicename
  • log into the service with dotcloud ssh appname.servicename, then go to the current directory, start python and see what happens if you try to do from wsgi import application

If that can help, here is a super-simple Pyramid app: https://github.com/jpetazzo/pyramid-on-dotcloud


I was able to get pass the uWSGI Error error using :

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

I still had a path problem with the static files so I changed:

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

to

config.add_static_view('<myapp>/static', 'static', cache_max_age=3600)


try this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜