rvanlaar/djangorecipe — Issue #18:  broken wsgi script generation in 0.17 
Author: rvanlaar
Created: 2011-12-27 21:40:20+00:00
State: open
Labels: Fix Released, Undecided

generating a wsgi stub on the 0.17 release creates a broken wsgi file.. here's some of the output

configuration

[django]
recipe = djangorecipe
project = wdl
settings = settings
pythonpath =
${buildout:directory}/lib
eggs =
${buildout:eggs}
${lxml:egg}
${mysql:egg}
wdl.ingest
pymarc
solrpy
version = 1.0.2
wsgi = true

wsgi stub bottom half

# Set our settings module
os.environ['DJANGO_SETTINGS_MODULE'] = 'wdl.settings'

import datetime
class logger(object):
def __init__(self, logfile):
self.logfile = logfile

def write(self, data):
self.log(data)

def writeline(self, data):
self.log(data)

def log(self, msg):
line = '%s - %s
' % (
datetime.datetime.now().strftime('%Y%m%d %H:%M:%S'), msg)
fp = open(self.logfile, 'a')
try:
fp.write(line)
finally:
fp.close()
sys.stdout = sys.stderr = logger('')

import django.core.handlers.wsgi

# Run WSGI handler for the application
application = django.core.handlers.wsgi.WSGIHandler()