[英]python pyramid mongo and wsgi : “Cannot connect to the database” in production
我試圖使用wsgi.py在dotcloud上運行pyramid + mongodb
import os, sys
from paste.deploy import loadapp
current_dir = os.path.dirname(__file__)
application = loadapp('config:production.ini', relative_to=current_dir)
production.ini
mongodb.url = mongodb://root:PASSWORD@sarasa.dotcloud.com:18145
mongodb.db_name = my_data_base
錯誤 :“無法連接到數據庫”
在localhost運行時,在production.ini中僅更改mongodb.url
您的URI應該如下所示:
mongodb:// root:PASSWORD@sarasa.dotcloud.com:18145 / my_data_base
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.