[英]Unable to host Django app on Google Cloud Platform
I have built a django app and its working fine in local machine, I tried hosting it in Google Cloud Platform. 我已经构建了一个django应用程序,并且在本地计算机上可以正常工作,我尝试将其托管在Google Cloud Platform中。
When I created a VM Instance I was given a dedicated IP, there is already a app called Project. 创建VM实例时,我获得了专用IP,已经有一个名为Project的应用程序。 I cloned the repo beside this folder (this is the IP https://130.211.79.74 and this is the link to the default app https://130.211.79.74/Project ).
我在此文件夹旁边克隆了存储库(这是IP https://130.211.79.74 ,这是默认应用程序https://130.211.79.74/Project的链接)。 I tried accessing my app and I see a 404 error.
我尝试访问我的应用程序,但看到404错误。 Is there anything that am missing.
是否有任何遗漏的东西。
Use the good paths in your wsgi.py file : 使用wsgi.py文件中的正确路径:
import os
import sys
sys.path.append('installdir/apps/django/django_projects/my_new_project')
os.environ.setdefault("PYTHON_EGG_CACHE", "installdir/apps/django/django_projects/my_new_project/egg_cache")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_new_project.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Don't forget to reload Apache so that your modifications are taken into account. 不要忘记重新加载Apache,以便将您的修改考虑在内。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.