Oliver Burdekin
Oliver Burdekin

Reputation: 1108

How do you add a third party reusable app to django and deploy in openshift?

I've built a web app using django deployed on openshift. I'm trying to add the third party reusable app markdown-deux. I've followed the install instructions (used pip) and it works fine on the localhost development server.

I've added 'markdown_deux' to my settings.py and tried it with and without a requirements.txt. However, I still get a 500 error and from rhc tail the error "Import error: no module named markdown_deux".

I've tried restarting my app and resyncing the db but I'm still getting the same errors. I've RTFM but to no avail.

Upvotes: 0

Views: 315

Answers (2)

timo.rieber
timo.rieber

Reputation: 3867

Openshift has mechanisms to automatically check and add dependencies after each git push, depending on your application type. So you don't need to install dependencies manually.

For python applications modify the projects 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'],
)

Read all details at the Openshift Help Center.

Upvotes: 1

Daniel Roseman
Daniel Roseman

Reputation: 599490

You've used pip to install it locally, but you actually need to install it on your server as well. Usually you would do that by adding it to the requirements.txt file and ensuring that your deployment process includes running pip install -r requirements.txt on the server.

Upvotes: 1

Related Questions