Django troubleshooting

To run the commands in this article, you must log into your server via SSH with your Shell user. View the following articles for more information:

Application isn't working

If your application isn't working, make sure you’re using the correct usernames, passwords, database names, and hostnames in the /projectname/ file.

If you make changes to the code, such as working through the official tutorials, and they don't seem to work, make sure to kill any existing Python processes and reload the page:

[server]$ pkill python

Changes are not reflected

If you modified your application and your changes do not seem to be reflected, you may need to notify Passenger about your change by creating or modifying ~/

[server]$ touch /home/user/
Passenger looks for this file and reloads the application when this file is modified.

Shared hosting changes are not reflected

If you're using shared hosting and your changes do not seem to be reflected, you can notify Passenger about your change by running the following command:

[server]$ touch

Custom Python version

If you installed a custom version of Python in your directory and you'd like to use it, add the following to your file:

if sys.hexversion < 0x2060000: os.execl("/path/to/your/copy/of/python2.7", "python2.7", *sys.argv)

500 error

If you're getting meaningless 500 pages even though you have DEBUG enabled in your Django app, you're probably running into a Passenger problem dealing with errors. View the 500 Errors with Passenger WSGI Workaround article for details.

If you're following the Django tutorial or migrating an existing project, you may get "Premature end of script headers" in your sites Error log. This may be due to the Passenger file not including your project directory in its path. One solution is to open and add the following:


See also

Did this article answer your questions?

Article last updated .