Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

voxy/django-audio-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Audio Recorder

Create a javascript audio recorder and save audio files using django.

Installation

# Install the latest version with
pip install git+https://github.com/voxy/django-audio-recorder.git#egg=django-audio-recorder

Quickstart

Add audio_recorder to your installed apps in your django settings

INSTALLED_APPS = [
    ...
    audio_recorder,
    ...
]

Create your model to store the audio file using a FileField.

from django.db import models
from audio_recorder.models import AudioFileMixin

class AudioFile(AudioFileMixin, models.Model):
    pass

Create an audio recorder view using the AudioRecorderCreateViewMixin

from audio_recorder.views import AudioFileCreateViewMixin

class AudioFileCreateView(AudioFileCreateViewMixin):
    model = AudioFile

Register the view in your urls

urlpatterns = [
    url(r'audio-files/', AudioFileCreateView.as_view(create_field='audio_file'), name='audio-file-create')
]

Create a form and use the AudioFileWidget for the audio recorder

from django import forms
from audio_recorder.widgets import AudioFileWidget

class AudioFileForm(forms.ModelForm):
    class Meta:
        model = AudioFile
        widgets = {
            'audio_file': AudioFileWidget(url='audio-file-create'),
        }

Development

Setup the environment

git clone https://github.com/voxy/django-audio-recorder.git
cd django-audio-recorder/test_project
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Run the development server

make serve

Run lint & tests

make lint && make tests

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published