title: Django. Cannot upload Image in models
body: <p>I am doing Online School project. When i want to add a new language in the Teacher, image of this languages gets null. I got the similar code, but in Admin Page(not default admin). And code in Admin page is working and successfull uploading image for Language. So, i have question, why it is not uploading</p>
  <p>My views.</p>
  <pre><code>@user_passes_test(is_teacher)
  def teacher_add_language_view(request):
      languageForm=LanguageForm()
      if request.method=='POST':
          languageForm=LanguageForm(request.POST, request.FILES)
          if languageForm.is_valid():
              language=languageForm.save(commit=False)    
              author = TMODELS.Teacher.objects.get(user__username=request.user)
              language.author = author
              languageForm.save()
          else:
              print(&quot;you got error&quot;)
          return HttpResponseRedirect('teacher-languages')
      return render(request,'teacher/teacher_add_language.html',{'languages':languageForm})
  </code></pre>
  <p>My forms</p>
  <pre><code>class LanguageForm(forms.ModelForm):
      class Meta:
          model=QMODEL.Language
          fields=['title', 'image']
  </code></pre>
  <p>Language model</p>
  <pre><code>class Language(models.Model):
  
      class Meta:
          verbose_name='Язык'
          verbose_name_plural='Языки'
  
      title = models.CharField(max_length=100, 
                          verbose_name='Язык')
      author = models.ForeignKey(Teacher,
                              on_delete = models.SET_NULL, null = True,
                              blank=True)
      slug = models.SlugField(default='None', editable = False)
      image = models.ImageField(upload_to='main_menu_picture/', 
                              null=True, blank=True)
  </code></pre>
  <p>it gets null? Can you help? Thanks for your att</p>
  <p>Update:
  That is Admin view creating language code, It is placed in another folder/application</p>
  <pre><code>@login_required(login_url='adminlogin')
  @user_passes_test(is_admin)
  def admin_add_language_view(request):
      languageForm=forms.LanguageForm()
      if request.method=='POST':
          languageForm=forms.LanguageForm(request.POST, request.FILES)
          if languageForm.is_valid():
              language=languageForm.save(commit=False)    
           
              author=TMODEL.Teacher.objects.get(
                  id=request.POST.get('authorID'))
              language.author = author
              languageForm.save()
          else:
              print(&quot;form is invalid&quot;)
          return HttpResponseRedirect('/admin-view-language')
      return 
  </code></pre>
  <p>render(request,'exam/admin_add_language.html'{'languages':languageForm})</p>
  <p>UPDATE:
  HTML fle for teacher_add_languages</p>
  <pre><code>&lt;form method=&quot;POST&quot; autocomplete=&quot;off&quot; style=&quot;margin:100px;margin-top: 0px;&quot;&gt;
  {%csrf_token%}
  &lt;div class=&quot;form-group&quot;&gt;
    &lt;label for=&quot;course_name&quot;&gt;Title&lt;/label&gt;
    {% render_field languages.title class=&quot;form-control&quot; placeholder=&quot;Example: Databases&quot; %}
    &lt;label for=&quot;languageID&quot;&gt;Author&lt;/label&gt;
    {% render_field languages.author class=&quot;form-control&quot; placeholder=&quot;Author&quot; %}
    &lt;label for=&quot;question_number&quot;&gt;Image&lt;/label&gt;
    {% render_field languages.image class=&quot;form-control&quot; %}
  &lt;/div&gt;
  &lt;button type=&quot;submit&quot; class=&quot;btn btn-success&quot; style=&quot;border-radius: 0%;&quot;&gt;Submit Info&lt;/button&gt;
  </code></pre>
    
  <p>I am using widget_tweak.</p>