The Django view code above leads to a text file that contains a broken line:
this is a test of a really long line that has more words that could possibl= y fit in a single column of text. -------------------------------------------------------------------------------
Does anyone know how to change it so that the output file does not have lines? Are there any settings in Django that control this? Version 1.2 of Django.
Update - to backup the level and explain my original problem :) I am using the django registration application, which sends an email with an account activation link. This link is a long URL with a random token at the end (30+ characters), and as a result, the line breaks in the middle of the marker.
In case the problem is with the Django email file mailbox, I switched to the smtp server and started the built-in smtpd Python server in debug mode. This threw my email to the console where it was still broken.
I am sure that the work of django registration works, and millions of people use it from users. So this should be what I did wrong or incorrectly configured. I just don't understand that.
Update 2 - according to the message on the Django list, this is really the basic Python email.MIMEText object , which, if correctly, only pushes the problem back a bit more. He still doesn't tell me how to fix it. Looking at the documents, I do not see anything that even mentions the wrapper.
Update 3 (sigh) - I ruled out that this is a problem with the MIMEText object. I used a clean Python program and smtplib / MIMEText to create and send a test email, and it worked fine. He also used charset = "us-ascii", which, according to someone, was the only encoding that does not wrap text in MIMEText objects. I donโt know if this is correct or not, but I looked more closely at my Django email output and it has the utf-8 encoding.
Can the wrong encoding be a problem? And if so, how do I change it in Django?
Here's the whole output from Django's email:
---------- MESSAGE FOLLOWS ---------- Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: some_subject From: me@test.com To: me@test.com Date: Tue, 17 May 2011 19:58:16 -0000 this is a test of a really long line that has more words that could possibl= y fit in a single column of text. ------------ END MESSAGE ------------