Skip to content

Commit

Permalink
create music_streaming_website(Hactoberfest)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil1973 authored Oct 8, 2022
1 parent f2cc507 commit e1e0eb3
Show file tree
Hide file tree
Showing 96 changed files with 2,412 additions and 0 deletions.
21 changes: 21 additions & 0 deletions music_streaming_website/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 rajaprerak

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
81 changes: 81 additions & 0 deletions music_streaming_website/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Django based music streaming website
> https://galvanic-music.herokuapp.com/
![GitHub stars](https://img.shields.io/github/stars/varadbhogayata/music-player)
![GitHub forks](https://img.shields.io/github/forks/varadbhogayata/music-player)
[![Maintenance](https://img.shields.io/badge/maintained-yes-green.svg)](https://github.com/varadbhogayata/music-player/commits/master)
[![Website shields.io](https://img.shields.io/badge/website-up-yellow)](https://galvanic-music.herokuapp.com/)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)

### Website Preview
#### Home Page
<img src="website_images/Home.png" width="900">

#### Detail Page
<img src="website_images/Detail.png" width="900">

----

## Installation 📦

>pip install -r requirements.txt
#### Clone

- Clone this repo to your local machine.

#### Run server locally

```shell
$ python manage.py runserver
```
> Go to localhost:8000
---

## Features 📋
⚡️ SignUp and SignIn option.\
⚡️ Google SignUp and SignIn option.\
⚡️ Play song, view detailed information of song.\
⚡️ Search songs.\
⚡️ Filter songs based on language and singer.\
⚡️ Create new playlist.\
⚡️ Add/Remove songs to/from playlist.\
⚡️ Add/Remove songs to/from favourites.\
⚡️ Scroll through recently played/viewed songs.\
⚡️ Explore songs through your personalized playlist and favourites.


---

## Contributing 💡


#### Step 1

- **Option 1**
- 🍴 Fork this repo!

- **Option 2**
- 👯 Clone this repo to your local machine.


#### Step 2

- **Build your code** 🔨🔨🔨

#### Step 3

- 🔃 Create a new pull request.



## Team ✨

| <a href="https://rajaprerak.github.io" target="_blank">**Prerak Raja**</a> | <a href="https://varadbhogayata.github.io" target="_blank">**Varad Bhogayata**</a> |
| :---: |:---:|
| [![Prerak Raja](https://github.com/rajaprerak.png?size=100)](https://rajaprerak.github.io) | [![Varad Bhogayata](https://github.com/varadbhogayata.png?size=100)](https://varadbhogayata.github.io) ||
| <a href="https://github.com/rajaprerak" target="_blank">`github.com/rajaprerak`</a> | <a href="https://github.com/varadbhogayata" target="_blank">`github.com/varadbhogayata`</a>

## License 📄
This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE) file for details.
Empty file.
3 changes: 3 additions & 0 deletions music_streaming_website/authentication/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions music_streaming_website/authentication/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class AuthenticationConfig(AppConfig):
name = 'authentication'
42 changes: 42 additions & 0 deletions music_streaming_website/authentication/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms
from django.contrib.auth import authenticate


class UserLoginForm(forms.Form):
username = forms.CharField(widget=forms.TextInput(attrs={'class': 'validate', 'placeholder': 'Enter Username'}))
password = forms.CharField(widget=forms.PasswordInput(attrs={'placeholder': 'Enter Password'}))

def clean(self, *args, **kwargs):
username = self.cleaned_data.get("username")
password = self.cleaned_data.get("password")

if username and password:
user = authenticate(username=username, password=password)
if not user:
raise forms.ValidationError("This user does not exist!")
if not user.check_password(password):
raise forms.ValidationError("Incorrect password!")
if not user.is_active:
raise forms.ValidationError("This user is not active")
return super(UserLoginForm, self).clean(*args, **kwargs)


class RegistrationForm(UserCreationForm):
username = forms.CharField(widget=forms.TextInput(attrs={'placeholder': 'Username'}))
password1 = forms.CharField(label='Password', widget=forms.PasswordInput(attrs={'placeholder': 'Enter Password'}))
password2 = forms.CharField(
label='Password confirmation',
help_text='Enter the same password as before, for verification.',
widget=forms.PasswordInput(attrs={'placeholder': 'Re Enter Password'}))

class Meta:
model = User
fields = ['username', 'password1', 'password2', ]

def save(self, commit=True):
user = super(RegistrationForm, self).save(commit=False)
if commit:
user.save()
return user
Empty file.
3 changes: 3 additions & 0 deletions music_streaming_website/authentication/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
3 changes: 3 additions & 0 deletions music_streaming_website/authentication/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
9 changes: 9 additions & 0 deletions music_streaming_website/authentication/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.urls import path
from . import views

# Add URLConf
urlpatterns = [
path('login/', views.login_request, name='login'),
path('signup/', views.signup_request, name='signup'),
path('logout/', views.logout_request, name='logout'),
]
45 changes: 45 additions & 0 deletions music_streaming_website/authentication/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from .forms import UserLoginForm, RegistrationForm


# Create your views here.
def login_request(request):
title = "Login"
form = UserLoginForm(request.POST or None)
context = {
'form': form,
'title': title,
}
if form.is_valid():
username = form.cleaned_data.get('username')
password = form.cleaned_data.get('password')
user = authenticate(request, username=username, password=password)

login(request, user)
# messages.info(request, f"You are now logged in as {user}")
return redirect('index')
else:
print(form.errors)
# messages.error(request, 'Username or Password is Incorrect! ')
return render(request, 'authentication/login.html', context=context)


def signup_request(request):
title = "Create Account"
if request.method == "POST":
form = RegistrationForm(request.POST)
if form.is_valid():
form.save()
return redirect('login')
else:
form = RegistrationForm()

context = {'form': form, 'title': title}
return render(request, 'authentication/signup.html', context=context)


def logout_request(request):
logout(request)
# messages.info(request, "Logged out successfully!")
return redirect('index')
Binary file added music_streaming_website/db.sqlite3
Binary file not shown.
21 changes: 21 additions & 0 deletions music_streaming_website/manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys


def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'musicplayer.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)


if __name__ == '__main__':
main()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added music_streaming_website/media/Baarish.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added music_streaming_website/media/Sun_Saathiya.mp3
Binary file not shown.
Binary file not shown.
Binary file added music_streaming_website/media/aajseteri.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/asalmein.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/attention.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/banjarani.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/bekhayali.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/girlslikeyou.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/gulaabo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/haayeoye.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/kabira.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/letmeloveyou.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/ocean.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/skyfullofstars.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/sochnasake.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/sunsaathiya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added music_streaming_website/media/tiemedown.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
9 changes: 9 additions & 0 deletions music_streaming_website/musicapp/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.contrib import admin
from .models import *

# Register your models here.

admin.site.register(Song)
admin.site.register(Playlist)
admin.site.register(Favourite)
admin.site.register(Recent)
5 changes: 5 additions & 0 deletions music_streaming_website/musicapp/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class MusicappConfig(AppConfig):
name = 'musicapp'
2 changes: 2 additions & 0 deletions music_streaming_website/musicapp/forms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


27 changes: 27 additions & 0 deletions music_streaming_website/musicapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.0.6 on 2020-07-08 07:01

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Song',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=200)),
('album', models.CharField(max_length=200)),
('genre', models.CharField(max_length=100)),
('song_img', models.FileField(upload_to='')),
('year', models.IntegerField()),
('singer', models.CharField(max_length=200)),
('song_file', models.FileField(upload_to='')),
],
),
]
25 changes: 25 additions & 0 deletions music_streaming_website/musicapp/migrations/0002_playlist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.0.6 on 2020-07-09 14:44

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('musicapp', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Playlist',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('playlist_name', models.CharField(max_length=200)),
('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='musicapp.Song')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
25 changes: 25 additions & 0 deletions music_streaming_website/musicapp/migrations/0003_favourite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.0.6 on 2020-07-11 04:36

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('musicapp', '0002_playlist'),
]

operations = [
migrations.CreateModel(
name='Favourite',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('is_fav', models.BooleanField(default=False)),
('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='musicapp.Song')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
24 changes: 24 additions & 0 deletions music_streaming_website/musicapp/migrations/0004_recent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.0.6 on 2020-07-11 05:10

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('musicapp', '0003_favourite'),
]

operations = [
migrations.CreateModel(
name='Recent',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='musicapp.Song')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.0.6 on 2020-07-12 07:36

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('musicapp', '0004_recent'),
]

operations = [
migrations.RemoveField(
model_name='song',
name='genre',
),
migrations.AddField(
model_name='song',
name='language',
field=models.CharField(choices=[('Hindi', 'Hindi'), ('English', 'English')], default='Hindi', max_length=20),
),
]
Empty file.
Loading

0 comments on commit e1e0eb3

Please sign in to comment.