乘客的Django应用程序显示空主页
In my local environment, which is run by python manage.py runserver
I can visit normally the application home in my http://localhost:8000
在我的本地环境中,由python manage.py运行服务器运行我可以正常访问我的http:// localhost:8000中的应用程序主目录
On passenger, I can work with some endpoints of my system in the remote domain, but I cannot access http://my.domain.com/
or http://my.domain.com
. It shows a blank page, as in my local environment I can normally see the home.
在乘客上,我可以在远程域中使用我的系统的某些端点,但我无法访问http://my.domain.com/或http://my.domain.com。它显示一个空白页面,因为在我的本地环境中我通常可以看到家。
I then created another endpoint to show my home, to check static files and so, like:
http://localhost:8000/h
然后我创建了另一个端点来显示我的家,检查静态文件,如:http:// localhost:8000 / h
In passenger I can normally see http://my.domain.com/h
as my home page, but I cant really make it work to see the home page in the root of the domain (as in any other website): http://my.domain.com
在乘客我通常可以看到http://my.domain.com/h作为我的主页,但我真的无法在域的根目录中查看主页(如在任何其他网站中):http: //my.domain.com
In my url's I tried many, but no success.
在我的网址中我尝试了很多,但没有成功。
My django project is in public folder. And this is the folder structure I have for passenger.
我的django项目在公共文件夹中。这是我为乘客提供的文件夹结构。
/path/to/project/public
/path/to/project/passenger_wsgi.py
/path/to/project/tmp/restart.txt
How can I make this home work in http://my.domain.com
?
如何在http://my.domain.com上完成此主页工作?
Welcome any help
欢迎任何帮助
1 个解决方案
#1
0
It was quite clear.
很清楚。
As explained in the Docs,
如文件中所述,
The "public" subdirectory Passenger maps the directory named "public" to be the document root for your domain/subdomain.
If a static HTML file named "public/index.html" exists, it's then used as the response for requests for the root document (i.e., "/").
If you want your application to handle requests for the root document, then you must first remove "public/index.html" (if it exists).
By default, Ruby on Rails creates a static "public/index.html" file.“public”子目录Passenger将名为“public”的目录映射为域/子域的文档根目录。如果存在名为“public / index.html”的静态HTML文件,则将其用作对根文档(即“/”)的请求的响应。如果您希望应用程序处理根文档的请求,则必须先删除“public / index.html”(如果存在)。默认情况下,Ruby on Rails创建一个静态的“public / index.html”文件。
Wasted few hours of my time in this wtf.
我在这个wtf中浪费了几个小时的时间。
更多相关文章
- 使用python api递归计算每个Dropbox文件夹大小
- 如何在python中播放wav文件?
- Python - 将值打印到新文件?
- 如何让TkInter文件选择对话框与IPython / Spyder一起使用?
- 用python将二进制整数或字符串写入文件
- 使用pandas read_table读取csv文件
- Python -在文本文件中添加日期戳
- 在读取和评估文件列表时加速Python eval。
- python 处理csv文件的过程对换行符的处理