title: Recording audio in Django model
body: <p>Hey i would like to record an audio as a voice note in one of my models:</p>
  
  <pre><code>class ShipPhoto(models.Model):
      user_name      = models.ForeignKey(User, on_delete=models.CASCADE)
      photo          = models.ImageField()
      voice_record   = ??????
      carplates      = models.CharField(max_length=20)
  </code></pre>
  
  <p>So that when i open the form_template i can click the voice record and upload the recorded message to my model. I've checked this link <a href="https://github.com/voxy/django-audio-recorder" rel="noreferrer">https://github.com/voxy/django-audio-recorder</a> but when i install it using pip command it automatically uninstalls my current version of django (2.0.8) and downgrades to 1.8 ... Is there any other solutions how can i do it ?? </p>
  
  <p>====================================================================
  UPDATED (10/10)</p>
  
  <p>Still not sure how could i incorporate videojs in my Django Form. Below you can see my ModelForm, views.py and template.</p>
  
  <p>ModelForm</p>
  
  <pre><code>class ShipPhotoForm(ModelForm):
      class Meta:
          model = ShipPhoto
          exclude= ('user_name',)
  
      def save_model(self, request, obj, form, change):
          if not obj.pk:
              obj.user_name = request.user
          obj.save()
  </code></pre>
  
  <p>views.py </p>
  
  <pre><code>class ShipPhotoCreate(LoginRequiredMixin, View):
  
      login_url = '/accounts/login/'
      redirect_field_name = 'redirect_to'
  
      form_class = ShipPhotoForm
      template_name = 'photo/shipphoto_form.html'
  
      def create_object(self, audio_file):
          return self.model.objects.create(**{self.create_field: audio_file})
  
      def get(self, request):
          form =self.form_class(None)
          return render(request, self.template_name, {'form':form})
  
      def post(self,request):
          form = self.form_class(request.POST, request.FILES)
          print(form.errors)
          if form.is_valid():  # uploader has been excluded. No more error.
              photo = form.save(commit=False)  # returns unsaved instance
              photo.user_name = request.user
              photo.save()  # real save to DB.
              return redirect('photo:main')
          return render(request,self.template_name,{})
  </code></pre>
  
  <p>template</p>
  
  <pre><code>{% extends "main/base.html" %}
  {% block content %}
  &lt;br&gt;
  &lt;div class="row"&gt;
      &lt;div class="col-sm-12 col-md-6"&gt;
          &lt;div class="panel panel-default"&gt;
              &lt;div class="panel-body"&gt;
                  &lt;form class="form-horizontal" action="" method="post" enctype="multipart/form-data"&gt;
                      {% csrf_token %}
                      {% include "form_template.html" %}
                      &lt;div class="form-group"&gt;
                          &lt;div class="col-sm-offset-2 col-sm-10"&gt;
                              &lt;button type="submit" class="btn btn-success"&gt;Submit/上传&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  
  <p>"form_template.html"</p>
  
  <pre><code>{% for field in form %}
   &lt;div class="form-group"&gt;
      &lt;div class="col-sm-offset-2 col-sm-10"&gt;
          &lt;span class="text-danger small"&gt;{{ field.errors }} &lt;/span&gt;
      &lt;/div&gt;
      &lt;label class="control-label col-sm-2"&gt;{{ field.label_tag }}&lt;/label&gt;
      &lt;div class="col-sm-10"&gt;{{ field }}&lt;/div&gt;
   &lt;/div&gt;
  
  {% endfor %}
  </code></pre>
  
  <p>Could i overwrite the <code>{{field}}</code> for <code>shiphoto.voice_record</code> so that it works with .js plugin or sth like that. I am not quite sure how to add the .js script to my template so that when opening the ShipPhotoCreate(View) and clicking the <code>voice_record</code> field it would prompt my cellphone to open a voice record and then save it in the data base. </p>