Django rest_framework在rhcloud.com上不起作用

时间:2016-05-04 17:25:56

标签: python django django-rest-framework openshift

我使用django创建了非常简单的应用程序并且可以在rhcloud.com上运行但是当我尝试添加rest_framework时如下所示

文件 settings.py

circle.yml

文件 urls.py

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    "rest_framework"
]

然后看到它已部署成功,但是当进入网页时,我得到错误503服务不可用

我真的在远程ssh app

运行pip install djangorestframework

我使用django 1.9.6,rest_framework 3.3.3

如果您之前有此解决方案,请分享给我解决方案

1 个答案:

答案 0 :(得分:0)

您是否使用djangorestframework deps更新了 setup.py

#!/usr/bin/env python

from setuptools import setup

setup(
    # GETTING-STARTED: set your app name:
    name='YourAppName',
    # GETTING-STARTED: set your app version:
    version='1.0',
    # GETTING-STARTED: set your app description:
    description='OpenShift App',
    # GETTING-STARTED: set author name (your name):
    author='Your Name',
    # GETTING-STARTED: set author email (your email):
    author_email='example@example.com',
    # GETTING-STARTED: set author url (your url):
    url='http://www.python.org/sigs/distutils-sig/',
    # GETTING-STARTED: define required django version:
    install_requires=[
        'Django==1.8.4',
        'djangorestframework==3.3.2',
    ],
    dependency_links=[
        'https://pypi.python.org/simple/django/',
        'https://pypi.python.org/simple/djangorestframework/',
    ],
 )