headers = {'Content-Type': 'text/plain'}
if type(self.body) == bytes:
    data = self.body
elif type(self.body) == str:
    data = self.body.encode('utf-8')
else:
    print('somthing is wrong')
r = requests.post('https://api.github.com/markdown/raw', headers=headers,
    data=data)
self.html_file.save(self.title + '.html', ContentFile(r.text.encode('utf-8'
    )), save=False)
self.html_file.close()
How do I implement markdown in Django 1.6 app?