Package: django-audiotracks
ADjangoapp to publish audio tracks.Introductiondjango-audiotracks is a simpleDjangoapp that allows your users to publish
audio tracks in various formats (Ogg Vorbis, Flac, MP3, WAV). It ships with a
defaultTrackmodel, a set of views, default templates, podcast feeds and
sensible default URL configuration.  It usesmutagento extract metadata from
audio files.  PIL is required to process images that can be attached to tracks.Default templates include the audio player fromMediaElement.js. I’ve added
some custom code for listing pages so that when a track ends playing, the next
one starts playing automatically.InstallationUsing PyPiYou can install django-audiotracks from PyPI using pip:$ pip install django-audiotracksFrom GitHubClone the repository with:$ git clone git://github.com/amarandon/django-audiotracks.gitThen install theaudiotrackspackage in your Python path. Asetup.pyscript is provided. You
can use it with a command such as:$ cd django-audiotracks
$ python setup.py installOr if you wish to modify the code:$ python setup.py developRun the example projectIf you get django-audiotracks from GitHub, an example project styled with
Twitter Bootstrap is provided with the source code. You can run it like this:$ cd <django-audiotracks_source_dir>/example_project/
$ python manage.py syncdb      # Create initial user at this stage
$ python manage.py runserverLog in and start uploading tracks.Addaudiotracksto your appEditsettings.pyand addaudiotracksto your list ofINSTALLED_APPS. Then synchronize your database with:$ python manage.py syncdbEdit yourROOT_URLCONFand add a piece of code similar to:urlpatterns += patterns('',
    # Here we mount the app under /music. Feel free to use something else
    url("^music", include("audiotracks.urls")),
    # Some URLs require a Django username
    url("^(?P<username>[\w\._-]+)/music", include("audiotracks.urls")),
)Visit the URL/music/uploadto upload your first track.ViewsUploadView function:upload_trackDefault URL: <app_mount_point>/uploadThis view allows authenticated users to upload a new audio file.  Metadata is
extracted from the file and used to prefill track attributes. Users get
redirected to the edit view.EditView function:edit_trackDefault URL: <app_mount_point>/edit/<id>Allow users to edit track attributes such as title, artist name, etc., upload an
image to attach to the track or change the audio file. Modified metadata
is stored back into the audio file itself if the format supports it (eg. it won’t
work with a WAV file).DisplayView function:track_detailURL: <app_mount_point_containing_username>/track/<slug>Display track. The URL pattern must capture ausernameargument, it will be
used in the query to select the track. For example, if the app is mounted using
the pattern"^(?P<username>[\w\._-]+)/music", a URL such as
/bob/music/track/love-forever will look for the track which slug is love-forever
and has been uploaded by bob. A user who is logged in and owns the track can see
links to the edit page for this track.DeleteView function:confirm_deleteDefault URL: <app_mount_point>/confirm_delete/<id>This is a confirmation page before deletion. Link to this page if you want to
provide a link to delete a track.View function:delete_trackDefault URL: <app_mount_point>/delete (takes id as POST a param)This view takes a track id as a POST parameter and delete the corresponding track.User tracks listingView function:user_indexDefault URL: <app_mount_point_containing_username>/If the app is mounted with a pattern containing a username such as"^(?P<username>[\w\._-]+)/music", a URL such as /bob/music will display a
list of tracks uploaded by bob.Latest tracks listingView function:latest_tracksDefault URL: <app_mount_point>/Show latest tracks by all users.Podcast feedsView functionfeeds.choose_feedDefault URL: <app_mount_point>/feed and <app_mount_point_containing_username>/feedChoose user feed or global feed depending on whether or not URL contains ausernameparameterM3U playlistsView functionviews.m3uDefault URLs: <app_mount_point>/m3u and <app_mount_point_containing_username>/m3uServe anM3Uplaylist file.ConfigurationAUDIOTRACKS_MODELDefault:audiotracks.Track(string)If the defaultTrackmodel doesn’t satisfy your needs, you can define your
own track model that inherits fromaudiotracks.models.AbstractTrack. For
instance if you wish to add tagging you might define a model like this:class MyTrack(AbstractTrack):
    tags = TagField(_("Tags"))Use theAUDIOTRACKS_MODELsetting to tell django-audiotracks about your
model, using the convention<app_name>.<model_class_name>. So if your model
is calledMyTrackand is located withing the appmyapp, use this
setting:AUDIOTRACKS_MODEL = 'myapp.MyTrack'AUDIOTRACKS_PODCAST_LIMITDefault:10(integer)Use this setting to specify how many tracks podcast feeds should contain.AUDIOTRACKS_PER_PAGEDefault:10(integer)Use this setting to specify how many tracks to display per listing page.