[英]Django rest_framework does not work on rhcloud.com
I created very simple app with django and runable on rhcloud.com but when I try to add rest_framework like as below 我用django创建了一个非常简单的应用程序,并且可以在rhcloud.com上运行,但是当我尝试添加rest_framework时,如下所示
file settings.py 文件settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
"rest_framework"
]
file urls.py 文件urls.py
from django.conf.urls import include
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
Then see that it deployed success but when enter webpage, I get error 503 Service Unavailable . 然后看到它部署成功,但是当进入网页时, 出现错误503 Service Unavailable 。
I really run pip install djangorestframework when remote ssh app 我确实在远程SSH应用程序运行pip install djangorestframework
I using django 1.9.6, rest_framework 3.3.3 我正在使用Django 1.9.6,rest_framework 3.3.3
Please share for me solution if you had it before 如果您之前有过,请为我分享解决方案
have you updated the setup.py with the djangorestframework deps? 您是否使用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/',
],
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.