在Bluehos上运行Django时子页未正确重定向

2024-05-18 11:05:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我们正在Bluehost上为Django应用程序设置一个测试环境,但遇到了一些问题。你知道吗

主页加载正常,但单击任何链接都找不到合适的页面(这在Heroku上的localhost和生产环境中工作正常)。你知道吗

.htaccess文件

AddHandler fcgid-script .fcgi
RewriteRule
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^$ /home2/naturbh2/public_html/dev/agile-atoll-6289/spicestore/SnapEDA.fcgi [QSA,L]
Options -Indexes

.fcgi文件

#!/home2/naturbh2/python27/bin/python2.7
import sys, os
from django.core.handlers.wsgi import WSGIHandler

# Add a custom Python path.
sys.path.insert(0, "/home2/naturbh2/public_html/dev/agile-atoll-6289")
sys.path.insert(0, "/home2/naturbh2/public_html/dev/agile-atoll-6289/spicestore")
sys.path.insert(0, "/home2/naturbh2/public_html/dev/agile-atoll-6289/spicestore/apps")
sys.path.insert(0, "/home2/naturbh2/python27")

#print sys.path

os.environ['DJANGO_SETTINGS_MODULE'] = 'spicestore.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

Tags: 文件pathdevimporthtmlsyspublicinsert