[Answered ]-Django: 500 internal server error with Passenger on Dreamhost

2👍

In the directory /home/user/example.com you need to add a symlink to your database file too.

Also:

  • You only need to append /home/user/example.com/project to the path. The other two are not necessary, though they should not cause problems.
  • Instead of hardcoding the path /home/user/example.com/project you can use os.getcwd():

    sys.path.append(os.path.join(os.getcwd(), 'project'))
    

After you make changes to this file or other files in your project, don’t forget to do touch tmp/restart.txt to notify Passenger.

By the way, at the moment Django works with Python versions 2.6.5 to 2.7 with experimental support for 3.2 and 3.3. According to the Python wiki on DreamHost, most servers should be using Python 2.6.6 as of February 2012, except some servers. Check your version of Python with python --version and if it’s not 2.6.6 then you can ask the support team to upgrade it on your server.

I tried using Django with Python 3.2 or 3.3 on DreamHost but it’s problematic. It doesn’t work with 3.2 because the mod_wsgi module of Apache does not seem to work with this version at the moment. It could work if you install it from source, but being a shared hosting, we don’t have control over that. I don’t know for sure but if mod_wsgi doesn’t work with 3.2 then it won’t work with 3.3 either. So I think it’s best to stick to a supported version of 2.x version if you want to use Django on Dreamhost.

👤janos

Leave a comment