Django Errors with Dreamhost

by

in

I was just setting up a Django environment on Dreamhost – and couldn’t work out what was going on.  Every time I tried to reach the admin page – I got an Internal Server Error 500 message.  Not very helpful.

First step was to check the Apache Error log.  From my home directory it was:  /logs/site_url.com/http/error.log
The last line of this file was pretty suspicious:

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.

A quick google showed this was related to Apache’s mod_rewrite.  And that you can specify it in the .htaccess file.  So under my /site_url.com directory I pulled up .htaccess.  And it showed this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Hang on a second.  WordPress?  Oh yeah – I had been originally running a WordPress install in the root directory for this server.  I then setup Django (using the public directory) but that hadn’t cleaned up .htaccess.  Delete that file — and the problem goes away.  Django Admin will load fine (or at least not throw the 500 Error).

Moral of the story: Clean up after yourself properly.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *