title: How to save text input as a file in HTML and Django
body: <p>I am building a site where users can input text and submit the text so that it can be saved and accessed as a file on the server. Unfortunately, I am not quite sure how I would take the inputted text and save it aas a file. </p>
  
  <p>Could anyone point me in the right direction as to how I might do this or detail the steps I will have to take? Preemptive apologizes if I have missed an obvious Google result. Being somewhat new to Django, I may have inadvertently glossed over helpful resources.</p>
  
  <p>Here is the relevant HTML, mostly a form copied from a file upload form:</p>
  
  <pre><code>&lt;form name="myWebForm" id="submissionCode_codeEditor" action="uploadFile/" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="hidden" name="MAX_FILE_SIZE" value="500" /&gt;
      &lt;input type="text" name="title" placeholder="File Name"/&gt;
      &lt;input type="hidden" name="taskID" value={{ taskID }} /&gt;
      &lt;input type="submit" value="Submit This Code" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is the relevant Django model: </p>
  
  <pre><code>class Upload(models.Model):
      title = models.CharField(max_length=50)
      fileUpload = models.FileField(upload_to='file_uploads')
      userID = models.ForeignKey(User)
      task = models.ForeignKey(Task)
      uploadTime = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
          return self.title
  </code></pre>