简体   繁体   English

如何在共享主机上部署 Django?

[英]How to deploy Django on share host?

I upload the project to a shared hosting account, and the .htaccess:我将项目上传到共享主机帐户,.htaccess:

AddHandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /yuanzhe/mysite/mysite/mysite2.fcgi/$1 [QSA,L]

but found 404 when I visit http://youdishou.com/hello但是在访问http://youdishou.com/hello时发现404

Thanks!谢谢!

Second argument to RewriteRule should be an URL: RewriteRule的第二个参数应该是 URL:

RewriteRule ^(.*)$ /mysite2.fcgi/$1 [QSA,L]

Anyway, visit http://youdishou.com/mysite2.fcgi不管怎样,访问http://youdishou.com/mysite2.fcgi

Looks like your hosting provider does not support fcgi at all.看起来您的托管服务提供商根本不支持 fcgi。 So it's better to contact hosting support to know if there is a way to start Django there.所以最好联系托管支持,了解那里是否有启动 Django 的方法。 Many providers do not support Django at all.许多提供商根本不支持 Django。

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

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