简体   繁体   English

django是否已经附带了wsgi应用程序文件,还是需要创建一个? 如何使用django设置apache和mod_wsgi?

[英]Does django already come with a wsgi application file, or do I need to create one? How to setup apache and mod_wsgi with django?

I am trying to deploy a web app with django, however I am having trouble with Apache and mod_wsgi. 我正在尝试使用django部署Web应用程序,但是我遇到了Apache和mod_wsgi的问题。 I have scoured the tutorials online, and none of them have provided me with accurate/sufficient information on how to set this up. 我已经在网上搜索了这些教程,但没有一个能为我提供有关如何设置它的准确/充分的信息。 I understand that I need an application.wsgi file/ a wsgi application file, however I am not sure as to whether I have to create on, or if django is pre-built with one. 我知道我需要一个application.wsgi文件/一个wsgi应用程序文件,但我不确定是否必须创建,或者django是否预先构建了一个。 If django does come with one, how do I tell apache to display my django app? 如果django确实附带一个,我怎么告诉apache显示我的django应用程序?

I am currently using Ubuntu Server 14.04 and I can do a runserver and see the application from localhost, however I want to fully deploy the website. 我目前正在使用Ubuntu Server 14.04,我可以做一个runserver并从localhost看到该应用程序,但我想完全部署该网站。 In other words, when I type in the IP of the server I want to see the home page that I made with django. 换句话说,当我输入服务器的IP时,我想看到我用django制作的主页。

The Django documentation has a guide that explains this. Django文档有一个解释这个的指南。

https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/ https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/modwsgi/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM