2015-01-15 22 views
0

我已經使用在openshift上部署的django構建了一個web應用程序。我正在嘗試添加第三方可重複使用的應用程序markdown-deux。我遵循安裝說明(使用pip),它在localhost開發服務器上工作正常。如何將第三方可重用應用程序添加到django並在openshift中部署?

我已經添加了「markdown_deux」我的settings.py有和沒有一個requirements.txt試了一下。但是,我仍然得到一個500錯誤,並從rhc尾部出現錯誤「導入錯誤:沒有名爲markdown_deux的模塊」。

我試着重新啓動我的應用程序,並重新同步的數據庫,但我仍然得到同樣的錯誤。我有RTFM但無濟於事。

回答

1

Openshift有機制來自動檢查每個git push之後添加的依賴關係,這取決於您的應用程序類型。所以你不需要手動安裝依賴關係。

對於Python應用程序修改項目setup.py

Python application owners should modify setup.py in the root of the git repository with the list of dependencies that will be installed using easy_install . The setup.py should look something like this:

from setuptools import setup 

setup(name='YourAppName', 
    version='1.0', 
    description='OpenShift App', 
    author='Your Name', 
    author_email='[email protected]', 
    url='http://www.python.org/sigs/distutils-sig/', 
    install_requires=['Django>=1.3', 'CloudMade'], 
) 

Openshift Help Center閱讀所有細節。

1

您使用了PIP在本地安裝,但實際上你需要在服務器上安裝它。通常你會做,通過將它添加到requirements.txt文件,並確保您的部署過程包括在服務器上運行pip install -r requirements.txt

相關問題