├── cloudPlayer ├── __init__.py ├── __init__.pyc ├── settings.py ├── settings.pyc ├── urls.py ├── urls.pyc ├── wsgi.py └── wsgi.pyc ├── db.sqlite3 ├── manage.py └── music ├── __init__.py ├── __init__.pyc ├── admin.py ├── admin.pyc ├── apps.py ├── apps.pyc ├── migrations ├── 0001_initial.py ├── 0001_initial.pyc ├── 0002_auto_20171211_1844.py ├── 0002_auto_20171211_1844.pyc ├── 0003_song_is_favorite.py ├── 0003_song_is_favorite.pyc ├── __init__.py └── __init__.pyc ├── models.py ├── models.pyc ├── static └── music │ ├── images │ └── background.jpg │ ├── init.js │ └── style.css ├── templates └── music │ ├── base.html │ ├── detail.html │ └── index.html ├── tests.py ├── urls.py ├── urls.pyc ├── views.py └── views.pyc /cloudPlayer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/cloudPlayer/__init__.py -------------------------------------------------------------------------------- /cloudPlayer/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/cloudPlayer/__init__.pyc -------------------------------------------------------------------------------- /cloudPlayer/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for cloudPlayer project. 3 | 4 | Generated by 'django-admin startproject' using Django 1.9. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/1.9/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '&g^81z0e_)n^h9)9ym2kg*-6j22_foalvlws%9clacxhe8%)q7' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'music.apps.MusicConfig', 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | ] 42 | 43 | MIDDLEWARE_CLASSES = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'cloudPlayer.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'cloudPlayer.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/1.9/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.sqlite3', 81 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 82 | } 83 | } 84 | 85 | 86 | # Password validation 87 | # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators 88 | 89 | AUTH_PASSWORD_VALIDATORS = [ 90 | { 91 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 92 | }, 93 | { 94 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 95 | }, 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 101 | }, 102 | ] 103 | 104 | 105 | # Internationalization 106 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ 107 | 108 | LANGUAGE_CODE = 'en-us' 109 | 110 | TIME_ZONE = 'UTC' 111 | 112 | USE_I18N = True 113 | 114 | USE_L10N = True 115 | 116 | USE_TZ = True 117 | 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/1.9/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | -------------------------------------------------------------------------------- /cloudPlayer/settings.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/cloudPlayer/settings.pyc -------------------------------------------------------------------------------- /cloudPlayer/urls.py: -------------------------------------------------------------------------------- 1 | """cloudPlayer URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/1.9/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Add an import: from blog import urls as blog_urls 14 | 2. Import the include() function: from django.conf.urls import url, include 15 | 3. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) 16 | """ 17 | from django.conf.urls import include, url 18 | from django.contrib import admin 19 | 20 | urlpatterns = [ 21 | url(r'^admin/', admin.site.urls), 22 | url(r'^music/', include('music.urls')), 23 | ] 24 | -------------------------------------------------------------------------------- /cloudPlayer/urls.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/cloudPlayer/urls.pyc -------------------------------------------------------------------------------- /cloudPlayer/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for cloudPlayer project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cloudPlayer.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /cloudPlayer/wsgi.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/cloudPlayer/wsgi.pyc -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/db.sqlite3 -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cloudPlayer.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /music/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/__init__.py -------------------------------------------------------------------------------- /music/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/__init__.pyc -------------------------------------------------------------------------------- /music/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Album, Song 3 | 4 | admin.site.register(Album) 5 | admin.site.register(Song) -------------------------------------------------------------------------------- /music/admin.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/admin.pyc -------------------------------------------------------------------------------- /music/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MusicConfig(AppConfig): 5 | name = 'music' 6 | -------------------------------------------------------------------------------- /music/apps.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/apps.pyc -------------------------------------------------------------------------------- /music/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2017-12-11 18:24 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | import django.db.models.deletion 7 | 8 | 9 | class Migration(migrations.Migration): 10 | 11 | initial = True 12 | 13 | dependencies = [ 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Album', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('artist', models.CharField(max_length=50)), 22 | ('album_title', models.CharField(max_length=150)), 23 | ('genre', models.CharField(max_length=30)), 24 | ('album_logo', models.CharField(max_length=1000)), 25 | ], 26 | ), 27 | migrations.CreateModel( 28 | name='Song', 29 | fields=[ 30 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 31 | ('file_type', models.CharField(max_length=10)), 32 | ('song_title', models.CharField(max_length=50)), 33 | ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='music.Album')), 34 | ], 35 | ), 36 | ] 37 | -------------------------------------------------------------------------------- /music/migrations/0001_initial.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/migrations/0001_initial.pyc -------------------------------------------------------------------------------- /music/migrations/0002_auto_20171211_1844.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2017-12-11 18:44 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('music', '0001_initial'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AlterField( 16 | model_name='album', 17 | name='album_title', 18 | field=models.CharField(max_length=500), 19 | ), 20 | migrations.AlterField( 21 | model_name='album', 22 | name='artist', 23 | field=models.CharField(max_length=250), 24 | ), 25 | migrations.AlterField( 26 | model_name='album', 27 | name='genre', 28 | field=models.CharField(max_length=100), 29 | ), 30 | migrations.AlterField( 31 | model_name='song', 32 | name='song_title', 33 | field=models.CharField(max_length=250), 34 | ), 35 | ] 36 | -------------------------------------------------------------------------------- /music/migrations/0002_auto_20171211_1844.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/migrations/0002_auto_20171211_1844.pyc -------------------------------------------------------------------------------- /music/migrations/0003_song_is_favorite.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Generated by Django 1.9 on 2017-12-11 22:18 3 | from __future__ import unicode_literals 4 | 5 | from django.db import migrations, models 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | ('music', '0002_auto_20171211_1844'), 12 | ] 13 | 14 | operations = [ 15 | migrations.AddField( 16 | model_name='song', 17 | name='is_favorite', 18 | field=models.BooleanField(default=False), 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /music/migrations/0003_song_is_favorite.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/migrations/0003_song_is_favorite.pyc -------------------------------------------------------------------------------- /music/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/migrations/__init__.py -------------------------------------------------------------------------------- /music/migrations/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/migrations/__init__.pyc -------------------------------------------------------------------------------- /music/models.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from django.db import models 4 | from django.core.urlresolvers import reverse 5 | 6 | 7 | class Album(models.Model): 8 | artist = models.CharField(max_length=250) 9 | album_title = models.CharField(max_length=500) 10 | genre = models.CharField(max_length=100) 11 | album_logo = models.CharField(max_length=1000) 12 | 13 | def get_absolute_url(self): 14 | return reverse('music:detail', kwargs={'pk':self.pk}) 15 | 16 | def __str__(self): 17 | return self.album_title + ' - ' + self.artist 18 | 19 | class Song(models.Model): 20 | album = models.ForeignKey(Album, on_delete=models.CASCADE) 21 | file_type = models.CharField(max_length=10) 22 | song_title = models.CharField(max_length=250) 23 | is_favorite = models.BooleanField(default=False) 24 | 25 | def __str__(self): 26 | return self.song_title -------------------------------------------------------------------------------- /music/models.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/models.pyc -------------------------------------------------------------------------------- /music/static/music/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmasieh/Django-Music-Player/991997a9a4f3cc5b60f62d4ba50e1f8d6b49d0d3/music/static/music/images/background.jpg -------------------------------------------------------------------------------- /music/static/music/init.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | $('.sidenav').sidenav(); 3 | $('.collapsible').collapsible(); 4 | }); -------------------------------------------------------------------------------- /music/static/music/style.css: -------------------------------------------------------------------------------- 1 | #layOut { 2 | background-color: #212121; 3 | color: #ffd700; 4 | } 5 | 6 | body { 7 | display: flex; 8 | min-height: 100vh; 9 | flex-direction: column; 10 | } 11 | 12 | main { 13 | flex: 1 0 auto; 14 | } 15 | 16 | .mobileSearch { 17 | margin: 0 0 0 50px !important; 18 | width: 60% !important; 19 | } 20 | 21 | .material-icons { 22 | color: #ffd700 !important; 23 | } 24 | 25 | #fontAwIcon { 26 | vertical-align: middle; 27 | line-height: 56px !important; 28 | } 29 | 30 | .activePage { 31 | color: #212121; 32 | background-color: #ffd700; 33 | } 34 | 35 | .brand-logo { 36 | font-family: Bungee; 37 | } -------------------------------------------------------------------------------- /music/templates/music/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Song Title | 52 |Audio File | 53 |Is a Favorite? | 54 |Actions? | 55 | 56 | 57 | {% for song in album.song_set.all %} 58 |
---|---|---|---|
{{ song.song_title }} | 60 |{{ song.file_type }} | 61 |{% if song.is_favorite %}
62 | ![]() |
64 | 65 | |
{{ album.artist }}
27 |