benoitc/gunicorn — pull request #316 by rbdrbd (2012-03-18 17:44:25+00:00)
Title: Allow launching of django projects where only .pyc files are distributed

For distribution of a specific project I have to my users, I use python's compileall to take the project to .pyc files, and then delete the original .py files. This is a relatively common practice, and doesn't cause any issues b/c python runs off of the pyc bytecode anyhow. However, when I try to run gunicorn, I get an error stating "django project not found". The reason is that gunicorn is looking for a settings.py file, and there is none.

Symlinking over settings.pyc to settings.py doesn't work, since python gives an error like "Non-ASCII character '\xf3' in file" as it's expecting a python source file.

With this simple fix, I wouldn't need to distribute the plaintext settings.py file to my project.