forked from Anadee11/WebArena
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create music_streaming_website(Hactoberfest)
- Loading branch information
1 parent
f2cc507
commit e1e0eb3
Showing
96 changed files
with
2,412 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Django based music streaming website | ||
> https://galvanic-music.herokuapp.com/ | ||
 | ||
 | ||
[](https://github.com/varadbhogayata/music-player/commits/master) | ||
[](https://galvanic-music.herokuapp.com/) | ||
[](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> | | ||
| :---: |:---:| | ||
| [](https://rajaprerak.github.io) | [](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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class AuthenticationConfig(AppConfig): | ||
name = 'authentication' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 added
BIN
+5.33 MB
music_streaming_website/media/01_-_Baarish_-_Half_Girlfriend_DJMaza.Life.mp3
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.44 MB
music_streaming_website/media/01_-_Soch_Na_Sake_Duet-MyMp3Singer.com.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 added
BIN
+3.15 MB
...c_streaming_website/media/DJ_Snake_-_Let_Me_Love_You_ft._Justin_Bieber_Official_Video.mp3
Binary file not shown.
Binary file added
BIN
+3.37 MB
music_streaming_website/media/Gryffin_-_Tie_Me_Down_ft._Elley_Duhé.mp3
Binary file not shown.
Binary file added
BIN
+3.54 MB
music_streaming_website/media/Guru_Randhawa_-_Ban_Ja_Tu_Meri_Rani.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+3.61 MB
music_streaming_website/media/Maroon_5_-_Girls_Like_You_ft._Cardi_B.mp3
Binary file not shown.
Binary file added
BIN
+2.81 MB
music_streaming_website/media/Mike_Perry_-_The_Ocean_ft._Shy_Martin_CC.mp3
Binary file not shown.
Binary file added
BIN
+5.46 MB
music_streaming_website/media/Songs.PK_08_-_Kabira_-_Yeh_Jawaani_Hai_Deewani.mp3
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.41 MB
music_streaming_website/media/Tujhe_Kitna_Chahne_Lage_-_Kabir_Singh_128_Kbps.mp3
Binary file not shown.
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.
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.
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.
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.
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.
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.
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.
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MusicappConfig(AppConfig): | ||
name = 'musicapp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
music_streaming_website/musicapp/migrations/0001_initial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
music_streaming_website/musicapp/migrations/0002_playlist.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
music_streaming_website/musicapp/migrations/0003_favourite.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
music_streaming_website/musicapp/migrations/0004_recent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)), | ||
], | ||
), | ||
] |
22 changes: 22 additions & 0 deletions
22
music_streaming_website/musicapp/migrations/0005_auto_20200712_1306.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.