DreamHost部署Django 4:首页正常其他页面触发内部重定向超限错误求助
DreamHost部署Django 4后非首页触发内部重定向超限错误
在DreamHost上部署Django 4项目,首页www.example.com访问正常,但访问其他页面(如www.example.com/foo/)时触发以下错误:
'Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.'
尝试自行解决未果,以下是相关配置文件:
配置文件详情
.htaccess文件(路径:/home/username/example.com/public/.htaccess)
RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /electiondata_private/$1 [L,QSA] AddHandler wsgi-script .wsgi
passenger.wsgi文件(路径:/home/username/example.com/passenger.wsgi)
import sys, os INTERP = "/home/analyzethevote/atv/electiondata-private/venv/bin/python3" #INTERP is present twice so that the new python interpreter #knows the actual executable path if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) cwd = os.getcwd() sys.path.append(cwd) sys.path.append(cwd + '/electiondata-private') #You must add your project here sys.path.insert(0,cwd+'/venv/bin') sys.path.insert(0,cwd+'/venv/lib/python3.9.16/site-packages') os.environ['DJANGO_SETTINGS_MODULE'] = "electiondata_private.settings" from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
恳请各位提供解决思路或方案。
内容的提问来源于stack exchange,提问作者Areeba Seher
相关产品推荐
相关产品推荐

