title: Django Upload Image in specific folder without FileField or ImageField and MEDIAROOT
body: <p>My App needs to upload different profile images in different folders inside the static folder.
  One more thing, I'm not using models, I just want to take the picture I choose in html input file and copy to the specific folder.</p>
  
  <p>Here is my folder tree. Where I want to save the uploaded image is in <code>MYPROJECTFOLDER/static/profile/&lt;TheUserSpecificFolder&gt;/</code> that's where I don't want to use <code>MEDIA_ROOT</code>, becouse in media root I can't create a specific folder to each user. (I don't know if this is correct, if there is a way to create a specific folder to each user in the /media/ folder without using <code>ImageField</code> or <code>FileField</code>, please tell me).</p>
  
  <p>Here is my folder tree:</p>
  
  <pre><code>MYPROJECTFOLDER
  |
  |------myproject/
  |
  |------myapp/
  |
  |------static
  |      |-------profile
  |              |------folder_user1
  |                     |------ uploadedpicture.jpg #Here is where I want to upload
  |                     |------folder_user2
  </code></pre>
  
  <p>Here is my  <em>uploadpic.html</em></p>
  
  <pre><code>&lt;form action="{% url 'upload' %}" enctype="multipart/form-data" method="POST"&gt;
    {% csrf_token %}
    &lt;input type="file" name="avatar" accept="image/gif, image/jpeg, image/png"&gt;
    &lt;button type="submit"&gt;Upload&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my <em>views.py</em></p>
  
  <pre><code>from django.shortcuts import render, HttpResponse, redirect
  from . import forms
  import os
  
  def upload(request):
    img = request.FILES['avatar']
    #This just create the folder where I want to save the image.
    if not os.path.exists('static/profile/' + str(request.session['user_id'])):
      os.mkdir('static/profile/' + str(request.session['user_id']))
  
    #NOW HERE IS WHERE I WANT TO WRITE THE CODE THAT SAVE THE IMAGE INTO THE FOLDER I JUST CREATED
  
  
  return redirect('companyedit')
  </code></pre>