Reputation: 52018
I have deployed a website which was built using django within bluehost. I can access all urls(like "/home", "/products/") and I get the webpages fine without any error. But when I try to access the API of the website, I get error 500:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I have used django-rest-framework here. I have checked the error log, its like this: 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.
my .htaccess is like this:
AddHandler fcgid-script .fcgi <br>
RewriteEngine On<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteRule ^(.*)$ demo.fcgi/$1 [QSA,L]
my fcgi file is like this:
#!/home3/env/python27/bin/python27
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/env/python27")
sys.path.insert(13, "/public_html/tcm/hyy/app")
os.environ['DJANGO_SETTINGS_MODULE'] = 'app.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
How can I solve this problem? PS: I have seen this solution but its not working: Request exceeded the limit of 10 internal redirects
Upvotes: 2
Views: 1309
Reputation: 30
Posting for any future sufferers:
Make sure your .htaccess
file is in the /home#/username/public_html
directory. Moving mine from /home#/username
solved this problem.
Upvotes: 1