diff --git a/README.md b/README.md
index 3f7634ad..c50d446a 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,6 @@
- Nurgul Akhshatayeva
- Levi Sawatzky
-- Sadman Shahriar Snigdho
- Axel Omar Sánchez Peralta
- MD Sakil Al Mahmud
- Aarsh Shah
diff --git a/backend/backend/.gitignore b/backend/backend/.gitignore
deleted file mode 100644
index 2eea525d..00000000
--- a/backend/backend/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.env
\ No newline at end of file
diff --git a/backend/backend/settings.py b/backend/backend/settings.py
deleted file mode 100644
index 34011e65..00000000
--- a/backend/backend/settings.py
+++ /dev/null
@@ -1,179 +0,0 @@
-"""
-Django settings for backend project.
-
-Generated by 'django-admin startproject' using Django 4.1.3.
-
-For more information on this file, see
-https://docs.djangoproject.com/en/4.1/topics/settings/
-
-For the full list of settings and their values, see
-https://docs.djangoproject.com/en/4.1/ref/settings/
-"""
-
-from pathlib import Path
-import environ
-
-# Build paths inside the project like this: BASE_DIR / 'subdir'.
-BASE_DIR = Path(__file__).resolve().parent.parent
-
-
-# Quick-start development settings - unsuitable for production
-# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
-
-# SECURITY WARNING: keep the secret key used in production secret! (added in the .env file!)
-env = environ.Env()
-environ.Env.read_env()
-
-SECRET_KEY = env('SECRET_KEY')
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = env('DEBUG')
-
-CORS_ORIGIN_WHITELIST = (
- u'http://localhost:8888',
- u'http://127.0.0.1:8000',
- u'http://localhost:58116',
-)
-
-ALLOWED_HOSTS = ['localhost', '127.0.0.1']
-
-
-# Application definition
-
-INSTALLED_APPS = [
- 'django.contrib.admin',
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- #internal
- 'backendcore.apps.BackendcoreConfig',
- #social apps plugin
- 'social_django',
- #external
- 'rest_framework',
- 'corsheaders',
- #social oauth
- 'oauth2_provider',
- 'rest_framework_social_oauth2',
-]
-
-MIDDLEWARE = [
- 'django.middleware.security.SecurityMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
- 'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.messages.middleware.MessageMiddleware',
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'corsheaders.middleware.CorsMiddleware',
- 'django.middleware.common.CommonMiddleware',
-]
-
-ROOT_URLCONF = 'backend.urls'
-
-TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'context_processors': [
- 'django.template.context_processors.debug',
- 'django.template.context_processors.request',
- 'django.contrib.auth.context_processors.auth',
- 'django.contrib.messages.context_processors.messages',
- 'social_django.context_processors.backends',
- 'social_django.context_processors.login_redirect',
- ],
- },
- },
-]
-
-WSGI_APPLICATION = 'backend.wsgi.application'
-
-#REST_FRAMEWORK and SIMPLEJWT
-REST_FRAMEWORK = {
- 'DEFAULT_PERMISSION_CLASSES': [
- 'rest_framework.permissions.IsAuthenticated',
- 'rest_framework.authentication.TokenAuthentication',
- ],
- 'DEFAULT_AUTHENTICATION_CLASSES': (
- 'rest_framework_simplejwt.authentication.JWTAuthentication',
- #oauth authentication
- 'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
- 'rest_framework_social_oauth2.authentication.SocialAuthentication',
- ),
-}
-
-AUTHENTICATION_BACKENDS = (
- 'rest_framework_social_oauth2.backends.DjangoOAuth2',
- 'django.contrib.auth.backends.ModelBackend',
-)
-
-from datetime import timedelta
-
-SIMPLE_JWT = {
- 'AUTH_HEADER_TYPES': ('JWT',),
- 'ACCESS_TOKEN_LIFETIME': timedelta(minutes=60),
- 'REFRESH_TOKEN_LIFETIME': timedelta(days=1),
-}
-
-# Database
-# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.sqlite3',
- 'NAME': BASE_DIR / 'db.sqlite3',
- }
-}
-
-
-# Password validation
-# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
-
-AUTH_PASSWORD_VALIDATORS = [
- {
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
- },
- {
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
- },
-]
-
-
-# Internationalization
-# https://docs.djangoproject.com/en/4.1/topics/i18n/
-
-LANGUAGE_CODE = 'en-us'
-
-TIME_ZONE = 'MDT'
-
-USE_I18N = True
-
-USE_TZ = True
-
-
-# Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/4.1/howto/static-files/
-
-STATIC_URL = 'static/'
-
-# Default primary key field type
-# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
-
-DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
-
-#social auth intregation'
-SOCIAL_AUTH_URL_NAMESPACE = 'social'
-SOCIAL_AUTH_SPOTIFY_KEY =env('API_KEY')
-SOCIAL_AUTH_SPOTIFY_SECRET =env('SPOT_SECRETKEY')
-SOCIAL_AUTH_SPOTIFY_SCOPE = ['user-read-email', 'user-library-read']
-
diff --git a/backend/backendcore/urls.py b/backend/backendcore/urls.py
deleted file mode 100644
index 30146b1a..00000000
--- a/backend/backendcore/urls.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.urls import path, include
-from . import views
-
-urlpatterns = [
- path('hellodjango', views.hello_django, name ='hellodjango'),
-]
diff --git a/backend/backendcore/views.py b/backend/backendcore/views.py
deleted file mode 100644
index ae14ee41..00000000
--- a/backend/backendcore/views.py
+++ /dev/null
@@ -1,13 +0,0 @@
-from django.shortcuts import render, HttpResponse
-from django.http import HttpResponse
-from rest_framework.response import Response
-from rest_framework.permissions import AllowAny
-from rest_framework.decorators import api_view, permission_classes
-
-# Create your views here.
-
-@api_view(['GET'],)
-@permission_classes([AllowAny],)
-def hello_django(request):
- print('Request Received!')
- return Response({'message: Hello PepegaClap!'}, status = 200)
\ No newline at end of file
diff --git a/backend/bandist/.cache b/backend/bandist/.cache
new file mode 100644
index 00000000..e0cb7900
--- /dev/null
+++ b/backend/bandist/.cache
@@ -0,0 +1 @@
+{"access_token": "BQDe6ZJo5JGUYDBSbdJeKCRj5VP1GZuzYx6fCCK36INkHAMmnQjPPP5nogICtjRxHmollIDoTvoWimA-ml2KfFjA1xTnRkPTKXtmsrtBUcIOh_rMGjUOvr4WODKOs6MpVUchmnGumjG4CsoDCfp0oXmDtTHPeaQLNY6DFZq577c7pqoxqJdqCeSum1rBgMeo4RJpVU-E8Mq1XMLBkPZzX_lqdBN32-OMMQr2OPlRd8Za", "token_type": "Bearer", "expires_in": 3600, "scope": null, "expires_at": 1680209640, "refresh_token": "AQCVMdxlSPE1K01LhdUIOspvjG_4EYV6cyUSda8ogBB_iZm4CI7hV1-eATRgVjDjaVIf9BtZvjtu8ET5YxqIVpsW5lGEbuf_Jqdy7Mqi6K_ZFglnk745UEqDoqUuL8fggLQ"}
\ No newline at end of file
diff --git a/backend/backend/__init__.py b/backend/bandist/app/__init__.py
similarity index 100%
rename from backend/backend/__init__.py
rename to backend/bandist/app/__init__.py
diff --git a/backend/bandist/app/admin.py b/backend/bandist/app/admin.py
new file mode 100644
index 00000000..c4a654c4
--- /dev/null
+++ b/backend/bandist/app/admin.py
@@ -0,0 +1,4 @@
+from django.contrib import admin
+from .models import User
+
+admin.site.register(User)
diff --git a/backend/backendcore/apps.py b/backend/bandist/app/apps.py
similarity index 60%
rename from backend/backendcore/apps.py
rename to backend/bandist/app/apps.py
index e622775b..ed327d22 100644
--- a/backend/backendcore/apps.py
+++ b/backend/bandist/app/apps.py
@@ -1,6 +1,6 @@
from django.apps import AppConfig
-class BackendcoreConfig(AppConfig):
+class AppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
- name = 'backendcore'
+ name = 'app'
diff --git a/backend/bandist/app/migrations/0001_initial.py b/backend/bandist/app/migrations/0001_initial.py
new file mode 100644
index 00000000..37fcae5c
--- /dev/null
+++ b/backend/bandist/app/migrations/0001_initial.py
@@ -0,0 +1,25 @@
+# Generated by Django 4.1.4 on 2022-12-25 18:53
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='User',
+ fields=[
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('spotify_id', models.CharField(max_length=255, unique=True)),
+ ('display_name', models.CharField(max_length=255)),
+ ('city', models.CharField(max_length=255)),
+ ('access_token', models.CharField(max_length=255)),
+ ('refresh_token', models.CharField(max_length=255)),
+ ],
+ ),
+ ]
diff --git a/backend/bandist/app/migrations/0002_remove_user_access_token_remove_user_city_and_more.py b/backend/bandist/app/migrations/0002_remove_user_access_token_remove_user_city_and_more.py
new file mode 100644
index 00000000..dd6653b2
--- /dev/null
+++ b/backend/bandist/app/migrations/0002_remove_user_access_token_remove_user_city_and_more.py
@@ -0,0 +1,25 @@
+# Generated by Django 4.1.3 on 2023-01-10 09:06
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('app', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='user',
+ name='access_token',
+ ),
+ migrations.RemoveField(
+ model_name='user',
+ name='city',
+ ),
+ migrations.RemoveField(
+ model_name='user',
+ name='refresh_token',
+ ),
+ ]
diff --git a/backend/bandist/app/migrations/0003_user_access_token_user_city_user_favorite_artists_and_more.py b/backend/bandist/app/migrations/0003_user_access_token_user_city_user_favorite_artists_and_more.py
new file mode 100644
index 00000000..61c0cc12
--- /dev/null
+++ b/backend/bandist/app/migrations/0003_user_access_token_user_city_user_favorite_artists_and_more.py
@@ -0,0 +1,35 @@
+# Generated by Django 4.1.3 on 2023-03-30 19:59
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('app', '0002_remove_user_access_token_remove_user_city_and_more'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='user',
+ name='access_token',
+ field=models.CharField(default='', max_length=255),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='city',
+ field=models.CharField(blank=True, max_length=50, null=True),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='favorite_artists',
+ field=models.TextField(blank=True, null=True),
+ ),
+ migrations.AddField(
+ model_name='user',
+ name='refresh_token',
+ field=models.CharField(default='', max_length=255),
+ preserve_default=False,
+ ),
+ ]
diff --git a/backend/backendcore/__init__.py b/backend/bandist/app/migrations/__init__.py
similarity index 100%
rename from backend/backendcore/__init__.py
rename to backend/bandist/app/migrations/__init__.py
diff --git a/backend/bandist/app/models.py b/backend/bandist/app/models.py
new file mode 100644
index 00000000..0b9e9334
--- /dev/null
+++ b/backend/bandist/app/models.py
@@ -0,0 +1,24 @@
+# from django.db import models
+
+# class User(models.Model):
+# spotify_id = models.CharField(max_length=255, unique=True)
+# display_name = models.CharField(max_length=255)
+# # city = models.CharField(max_length=255)
+# # access_token = models.CharField(max_length=255)
+# # refresh_token = models.CharField(max_length=255)
+
+# class Meta:
+# app_label = 'app'
+
+from django.db import models
+
+class User(models.Model):
+ spotify_id = models.CharField(max_length=255, unique=True)
+ display_name = models.CharField(max_length=255)
+ city = models.CharField(max_length=50, blank=True, null=True)
+ access_token = models.CharField(max_length=255)
+ refresh_token = models.CharField(max_length=255)
+ favorite_artists = models.TextField(blank=True, null=True)
+
+ class Meta:
+ app_label = 'app'
\ No newline at end of file
diff --git a/backend/bandist/app/templates/base.html b/backend/bandist/app/templates/base.html
new file mode 100644
index 00000000..2035d4d3
--- /dev/null
+++ b/backend/bandist/app/templates/base.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+ Concert Recommendation
+
+
+
+
+
+ {% block content %}
+ {% endblock %}
+
+
+
\ No newline at end of file
diff --git a/backend/bandist/app/templates/dashboard.html b/backend/bandist/app/templates/dashboard.html
new file mode 100644
index 00000000..536ff934
--- /dev/null
+++ b/backend/bandist/app/templates/dashboard.html
@@ -0,0 +1,41 @@
+{% extends 'base.html' %}
+
+{% block content %}
+
+
+
+
+ {% for artist in top_artists %}
+
Upcoming concerts for {{ artist.name }}
+
+ {% for concert in concerts %}
+ {% if concert.performers.0.name == artist.name %}
+
+
{{ concert.title }}
+
Date: {{ concert.datetime_local|date:'D M d, Y' }}
+
City: {{ concert.venue.city }}
+
Min Price: {{ concert.stats.lowest_price }}
+
Max Price: {{ concert.stats.highest_price }}
+
Ticket URL
+
+ {% endif %}
+ {% endfor %}
+ {% if not concerts %}
+
No upcoming concerts
+ {% endif %}
+
+ {% endfor %}
+
+
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/backend/bandist/app/templates/home.html b/backend/bandist/app/templates/home.html
new file mode 100644
index 00000000..16088b3d
--- /dev/null
+++ b/backend/bandist/app/templates/home.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+ Bandist
+
+
+
+
+
+
+ {% block content %}
+ {% endblock %}
+
+
+
\ No newline at end of file
diff --git a/backend/backendcore/tests.py b/backend/bandist/app/tests.py
similarity index 100%
rename from backend/backendcore/tests.py
rename to backend/bandist/app/tests.py
diff --git a/backend/bandist/app/urls.py b/backend/bandist/app/urls.py
new file mode 100644
index 00000000..d097c161
--- /dev/null
+++ b/backend/bandist/app/urls.py
@@ -0,0 +1,22 @@
+# from django.urls import path
+# from . import views
+
+# urlpatterns = [
+# path('login', views.login, name='login'),
+# path('login/callback/', views.login_callback, name='login_callback'),
+# # path('dashboard', views.dashboard, name='dashboard'),
+# path('getInfo', views.getInfo, name='get_info'),
+# ]
+
+from django.urls import path
+from . import views
+from django.contrib import admin
+
+urlpatterns = [
+ path('', views.home, name='home'),
+ path('login', views.login, name='login'),
+ path('login/callback/', views.login_callback, name='login_callback'),
+ path('dashboard/', views.dashboard, name='dashboard'),
+ path('admin/', admin.site.urls),
+ path('logout/', views.logout, name='logout'),
+]
\ No newline at end of file
diff --git a/backend/bandist/app/views.py b/backend/bandist/app/views.py
new file mode 100644
index 00000000..dc657a45
--- /dev/null
+++ b/backend/bandist/app/views.py
@@ -0,0 +1,210 @@
+# import spotipy
+# from spotipy.oauth2 import SpotifyOAuth
+# from django.shortcuts import render, redirect
+# from .models import User
+# from django.conf import settings
+# import time
+# import requests
+
+# TOKEN_INFO = "token_info"
+
+# def login(request):
+# sp_oauth = SpotifyOAuth(
+# client_id=settings.SPOTIPY_CLIENT_ID,
+# client_secret=settings.SPOTIPY_CLIENT_SECRET,
+# redirect_uri=settings.SPOTIPY_REDIRECT_URI,
+# scope='user-read-private user-read-email user-library-read user-follow-read user-top-read',
+# )
+# login_url = sp_oauth.get_authorize_url()
+
+# return redirect(login_url)
+
+# def login_callback(request):
+# cache_handler = spotipy.cache_handler.MemoryCacheHandler()
+
+# authorization_code = request.GET.get('code')
+# sp_oauth = SpotifyOAuth(
+# client_id=settings.SPOTIPY_CLIENT_ID,
+# client_secret=settings.SPOTIPY_CLIENT_SECRET,
+# redirect_uri=settings.SPOTIPY_REDIRECT_URI,
+# cache_handler=cache_handler,
+# )
+# token_info = sp_oauth.get_access_token(authorization_code)
+# request.session.create()
+
+# request.session[TOKEN_INFO] = token_info
+# return redirect('/getInfo')
+
+
+
+# def getInfo(request):
+
+# token_info = request.session.get(TOKEN_INFO, None)
+
+# if not token_info:
+# redirect_uri = settings.SPOTIPY_REDIRECT_URI
+# sp_oauth = SpotifyOAuth(
+# client_id=settings.SPOTIPY_CLIENT_ID,
+# client_secret=settings.SPOTIPY_CLIENT_SECRET,
+# redirect_uri=redirect_uri,
+# scope=["user-library-read","user-top-read"] #here you can specify scopes
+# )
+# auth_url = sp_oauth.get_authorize_url()
+# return redirect(auth_url)
+
+# now = int(time.time())
+# is_expired = token_info['expires_at'] - now < 60
+# if is_expired:
+# sp_oauth = SpotifyOAuth(
+# client_id=settings.SPOTIPY_CLIENT_ID,
+# client_secret=settings.SPOTIPY_CLIENT_SECRET,
+# redirect_uri=settings.SPOTIPY_REDIRECT_URI,
+# scope=["user-library-read","user-top-read"]
+# )
+# token_info = sp_oauth.refresh_access_token(token_info['refresh_token'])
+# request.session[TOKEN_INFO] = token_info
+
+# access_token = token_info['access_token']
+# sp = spotipy.Spotify(auth=access_token)
+# user = sp.current_user()
+
+# try:
+# user = User.objects.get(spotify_id=user['id'])
+# user.save()
+# except User.DoesNotExist:
+# # Create a new User object
+# user = User.objects.create(
+# spotify_id=user['id'],
+# display_name=user['display_name'],
+# )
+# top_artists = sp.current_user_top_artists(limit=50, time_range='short_term')
+# follow_artists = sp.current_user_followed_artists(limit=20, after=None)
+# print(follow_artists['artists']['items'][0]['id'])
+# print(follow_artists['artists']['items'][0]['name'])
+
+# my_headers = {'Authorization' : 'Bearer 561|iuTTRdE1SgKGBidlg6fB9YZbWrwkdUVL6bv3Rd1p'}
+# response = requests.get('https://zylalabs.com/api/94/music+gigs+and+concerts+tracker+api/146/get+concerts+by+artist?name=BTS', headers=my_headers)
+# print(response.text)
+# # artist = sp.artist()
+# # print(top_artists['items'][0])
+# # for artist in top_artists['items']:
+# # artist_id = artist['id']
+# # # Get the artist's top tracks
+# # top_tracks = sp.artist_top_tracks(artist_id)
+# # track_ids = [track['id'] for track in top_tracks['tracks']]
+# # # Search for events featuring the artist's top tracks
+# # # events = sp.events(track_ids=track_ids)
+# # # for event in events['events']:
+# # # if event['venue']['city'] == city:
+# # # concerts.append(event)
+# return render(request, 'dashboard.html', {
+# 'display_name': user.display_name,
+# 'top_artists': top_artists['items'],
+# })
+
+import spotipy
+from spotipy.oauth2 import SpotifyOAuth
+from django.shortcuts import render, redirect
+from .models import User
+from django.conf import settings
+
+import requests
+import json
+
+def login(request):
+ sp_oauth = SpotifyOAuth(
+ client_id=settings.SPOTIPY_CLIENT_ID,
+ client_secret=settings.SPOTIPY_CLIENT_SECRET,
+ redirect_uri=settings.SPOTIPY_REDIRECT_URI,
+ scope='user-read-private user-read-email user-library-read user-follow-read user-top-read',
+ )
+ login_url = sp_oauth.get_authorize_url()
+ return redirect(login_url)
+
+def login_callback(request):
+ authorization_code = request.GET.get('code')
+ sp_oauth = SpotifyOAuth(
+ client_id=settings.SPOTIPY_CLIENT_ID,
+ client_secret=settings.SPOTIPY_CLIENT_SECRET,
+ redirect_uri=settings.SPOTIPY_REDIRECT_URI,
+ )
+ token_info = sp_oauth.get_access_token(authorization_code)
+ access_token = token_info['access_token']
+ refresh_token = token_info['refresh_token']
+ sp = spotipy.Spotify(auth=access_token)
+ user = sp.current_user()
+ spotify_id = user['id']
+ display_name = user['display_name']
+ city = user.get('city', '')
+ favorite_artists = ','.join([artist['name'] for artist in sp.current_user_top_artists(limit=50, time_range='short_term')['items']])
+ try:
+ user = User.objects.get(spotify_id=spotify_id)
+ user.access_token = access_token
+ user.city = city
+ user.favorite_artists = favorite_artists
+ user.save()
+ except User.DoesNotExist:
+ user = User.objects.create(
+ spotify_id=spotify_id,
+ display_name=display_name,
+ city=city,
+ favorite_artists=favorite_artists,
+ access_token=access_token,
+ refresh_token=refresh_token,
+ )
+ request.session['user_id'] = spotify_id
+ return redirect('/dashboard')
+
+def logout(request):
+ # Clear the user's session data
+ request.session.clear()
+
+ # Redirect to the home page
+ return redirect('home')
+
+
+# SeatGeek implementation. Feel free to edit/remove it as far you wish. - Sakil
+
+def get_upcoming_events(artist_name):
+ base_url = 'https://api.seatgeek.com/2/events'
+ params = {
+ 'q': artist_name,
+ 'client_id': settings.SEATGEEK_CLIENT_ID,
+ 'per_page': 50
+ }
+ response = requests.get(base_url, params=params)
+ return response.json()
+
+
+def dashboard(request):
+ print("REACHED HERE_________________")
+ user_id = request.session['user_id']
+ user = User.objects.get(spotify_id=user_id)
+ print(user)
+ print(user.display_name)
+ access_token = user.access_token
+ sp = spotipy.Spotify(auth=access_token)
+ # Getting the top artists
+ top_artists = sp.current_user_top_artists(limit=50, time_range='short_term')
+ followed_artists = sp.current_user_followed_artists(limit=20, after=None)
+
+ # Seatgeek concerts
+ # concerts = []
+ # for artist in top_artists['items']:
+ # artist_name = artist['name']
+ # events = get_upcoming_events(artist_name)
+ # concerts.extend(events['events'])
+
+ concerts = []
+ for artist in followed_artists['artists']['items']:
+ artist_name = artist['name']
+ events = get_upcoming_events(artist_name)
+ concerts.extend(events['events'])
+
+ return render(request, 'dashboard.html', {
+ 'top_artists': followed_artists['artists']['items'],
+ 'concerts': concerts,
+ })
+
+def home(request):
+ return render(request, 'home.html')
\ No newline at end of file
diff --git a/backend/backendcore/migrations/__init__.py b/backend/bandist/bandist/__init__.py
similarity index 100%
rename from backend/backendcore/migrations/__init__.py
rename to backend/bandist/bandist/__init__.py
diff --git a/backend/backend/asgi.py b/backend/bandist/bandist/asgi.py
similarity index 75%
rename from backend/backend/asgi.py
rename to backend/bandist/bandist/asgi.py
index f4518a14..6281a561 100644
--- a/backend/backend/asgi.py
+++ b/backend/bandist/bandist/asgi.py
@@ -1,5 +1,5 @@
"""
-ASGI config for backend project.
+ASGI config for bandist project.
It exposes the ASGI callable as a module-level variable named ``application``.
@@ -11,6 +11,6 @@
from django.core.asgi import get_asgi_application
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bandist.settings')
application = get_asgi_application()
diff --git a/backend/bandist/bandist/settings.py b/backend/bandist/bandist/settings.py
new file mode 100644
index 00000000..27a47047
--- /dev/null
+++ b/backend/bandist/bandist/settings.py
@@ -0,0 +1,266 @@
+# """
+# Django settings for bandist project.
+
+# Generated by 'django-admin startproject' using Django 4.1.4.
+
+# For more information on this file, see
+# https://docs.djangoproject.com/en/4.1/topics/settings/
+
+# For the full list of settings and their values, see
+# https://docs.djangoproject.com/en/4.1/ref/settings/
+# """
+
+# from pathlib import Path
+
+# # Build paths inside the project like this: BASE_DIR / 'subdir'.
+# BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# # Quick-start development settings - unsuitable for production
+# # See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
+
+# # SECURITY WARNING: keep the secret key used in production secret!
+# # SECRET_KEY = 'django-insecure-59d(4*a3y9wj9a^*%8qsq9u(orz=&_9alc)vqgp((1@+uy+px-'
+# SECRET_KEY = "ui0pp)dodxk_wpwzbkn_@^mz-bq&^%c%h#8a(p-8my#y0oc1n1"
+# # SECURITY WARNING: don't run with debug turned on in production!
+# DEBUG = True
+
+# ALLOWED_HOSTS = []
+
+
+# # Application definition
+
+# INSTALLED_APPS = [
+# 'app.apps.AppConfig',
+# 'django.contrib.admin',
+# 'django.contrib.auth',
+# 'django.contrib.contenttypes',
+# 'django.contrib.sessions',
+# 'django.contrib.messages',
+# 'django.contrib.staticfiles',
+# ]
+
+# MIDDLEWARE = [
+# 'django.middleware.security.SecurityMiddleware',
+# 'django.contrib.sessions.middleware.SessionMiddleware',
+# 'django.middleware.common.CommonMiddleware',
+# 'django.middleware.csrf.CsrfViewMiddleware',
+# 'django.contrib.auth.middleware.AuthenticationMiddleware',
+# 'django.contrib.messages.middleware.MessageMiddleware',
+# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+# ]
+
+# ROOT_URLCONF = 'bandist.urls'
+
+# TEMPLATES = [
+# {
+# 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+# 'DIRS': [],
+# 'APP_DIRS': True,
+# 'OPTIONS': {
+# 'context_processors': [
+# 'django.template.context_processors.debug',
+# 'django.template.context_processors.request',
+# 'django.contrib.auth.context_processors.auth',
+# 'django.contrib.messages.context_processors.messages',
+# ],
+# },
+# },
+# ]
+
+# WSGI_APPLICATION = 'bandist.wsgi.application'
+
+
+# # Database
+# # https://docs.djangoproject.com/en/4.1/ref/settings/#databases
+
+# DATABASES = {
+# 'default': {
+# 'ENGINE': 'django.db.backends.sqlite3',
+# 'NAME': BASE_DIR / 'db.sqlite3',
+# }
+# }
+
+
+# # Password validation
+# # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
+
+# AUTH_PASSWORD_VALIDATORS = [
+# {
+# 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+# },
+# {
+# 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+# },
+# {
+# 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+# },
+# {
+# 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+# },
+# ]
+
+
+# # Internationalization
+# # https://docs.djangoproject.com/en/4.1/topics/i18n/
+
+# LANGUAGE_CODE = 'en-us'
+
+# TIME_ZONE = 'UTC'
+
+# USE_I18N = True
+
+# USE_TZ = True
+
+
+# # Static files (CSS, JavaScript, Images)
+# # https://docs.djangoproject.com/en/4.1/howto/static-files/
+
+# STATIC_URL = 'static/'
+
+# # Default primary key field type
+# # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
+
+# DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+
+# #SPOTIPY
+# SPOTIPY_CLIENT_ID = "73179dc2625a435f8a3672b3379ceadd"
+# SPOTIPY_CLIENT_SECRET = "74a1523073d9411ab200160c41f7e07f"
+# SPOTIPY_REDIRECT_URI = "http://127.0.0.1:8000/login/callback/"
+
+
+# #SEATGEEK
+# SEATGEEK_CLIENT_ID = "MzE2NDYwNTB8MTY3NDc2NTA1MC42NTMyNjcx"
+# SEATGEEK_CLIENT_SECRET = "a2351d302e8fb7bfc95b6240df4f45f1b792396653d69844b406505c5330b76c"
+
+
+"""
+Django settings for bandist project.
+Generated by 'django-admin startproject' using Django 4.1.4.
+For more information on this file, see
+https://docs.djangoproject.com/en/4.1/topics/settings/
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/4.1/ref/settings/
+"""
+
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'django-insecure-59d(4*a3y9wj9a^*%8qsq9u(orz=&_9alc)vqgp((1@+uy+px-'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = [
+ 'app',
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+]
+
+MIDDLEWARE = [
+ 'django.middleware.security.SecurityMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+]
+
+ROOT_URLCONF = 'bandist.urls'
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+ },
+]
+
+WSGI_APPLICATION = 'bandist.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': BASE_DIR / 'db.sqlite3',
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/4.1/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/4.1/howto/static-files/
+
+STATIC_URL = 'static/'
+
+# Default primary key field type
+# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+
+#SPOTIPY
+SPOTIPY_CLIENT_ID = "d4aa56ab1e3243168d3be322b8cad9af"
+SPOTIPY_CLIENT_SECRET = "831695beab5c4d5e9c8f2bc42bdbe422"
+SPOTIPY_REDIRECT_URI = "http://127.0.0.1:8000/login/callback/"
+
+#SEATGEEK
+SEATGEEK_CLIENT_ID = "MzE2NDYwNTB8MTY3NDc2NTA1MC42NTMyNjcx"
+SEATGEEK_CLIENT_SECRET = "a2351d302e8fb7bfc95b6240df4f45f1b792396653d69844b406505c5330b76c"
\ No newline at end of file
diff --git a/backend/backend/urls.py b/backend/bandist/bandist/urls.py
similarity index 82%
rename from backend/backend/urls.py
rename to backend/bandist/bandist/urls.py
index b1e03c15..400ed4f9 100644
--- a/backend/backend/urls.py
+++ b/backend/bandist/bandist/urls.py
@@ -1,4 +1,4 @@
-"""backend URL Configuration
+"""bandist URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.1/topics/http/urls/
@@ -18,7 +18,6 @@
urlpatterns = [
path('admin/', admin.site.urls),
- path('auth/', include('rest_framework_social_oauth2.urls')),
+ path('', include('app.urls')),
]
-urlpatterns += [path('app/',include('backendcore.urls'))]
\ No newline at end of file
diff --git a/backend/backend/wsgi.py b/backend/bandist/bandist/wsgi.py
similarity index 75%
rename from backend/backend/wsgi.py
rename to backend/bandist/bandist/wsgi.py
index c4aa3242..e1c0e2ef 100644
--- a/backend/backend/wsgi.py
+++ b/backend/bandist/bandist/wsgi.py
@@ -1,5 +1,5 @@
"""
-WSGI config for backend project.
+WSGI config for bandist project.
It exposes the WSGI callable as a module-level variable named ``application``.
@@ -11,6 +11,6 @@
from django.core.wsgi import get_wsgi_application
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bandist.settings')
application = get_wsgi_application()
diff --git a/backend/bandist/db.sqlite3 b/backend/bandist/db.sqlite3
new file mode 100644
index 00000000..25e7da59
Binary files /dev/null and b/backend/bandist/db.sqlite3 differ
diff --git a/backend/manage.py b/backend/bandist/manage.py
similarity index 90%
rename from backend/manage.py
rename to backend/bandist/manage.py
index eb6431e2..6af17698 100644
--- a/backend/manage.py
+++ b/backend/bandist/manage.py
@@ -6,7 +6,7 @@
def main():
"""Run administrative tasks."""
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bandist.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
diff --git a/backend/db.sqlite3 b/backend/db.sqlite3
deleted file mode 100644
index 6efa1a1d..00000000
Binary files a/backend/db.sqlite3 and /dev/null differ
diff --git a/backend/env/Lib/site-packages/Django-4.1.4.dist-info/AUTHORS b/backend/env/Lib/site-packages/Django-4.1.4.dist-info/AUTHORS
new file mode 100644
index 00000000..e5f2bd6d
--- /dev/null
+++ b/backend/env/Lib/site-packages/Django-4.1.4.dist-info/AUTHORS
@@ -0,0 +1,1047 @@
+Django was originally created in late 2003 at World Online, the web division
+of the Lawrence Journal-World newspaper in Lawrence, Kansas.
+
+Here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
+people who have submitted patches, reported bugs, added translations, helped
+answer newbie questions, and generally made Django that much better:
+
+ Aaron Cannon
+ Aaron Swartz
+ Aaron T. Myers
+ Abeer Upadhyay
+ Abhijeet Viswa
+ Abhinav Patil
+ Abhishek Gautam
+ Abhyudai
+ Adam Allred
+ Adam Bogdał
+ Adam Donaghy
+ Adam Johnson
+ Adam Malinowski
+ Adam Vandenberg
+ Ade Lee
+ Adiyat Mubarak
+ Adnan Umer
+ Arslan Noor
+ Adrian Holovaty
+ Adrian Torres
+ Adrien Lemaire
+ Afonso Fernández Nogueira
+ AgarFu
+ Ahmad Alhashemi
+ Ahmad Al-Ibrahim
+ Ahmed Eltawela
+ ajs
+ Akash Agrawal
+ Akis Kesoglou
+ Aksel Ethem
+ Akshesh Doshi
+ alang@bright-green.com
+ Alasdair Nicol
+ Albert Wang
+ Alcides Fonseca
+ Aldian Fazrihady
+ Aleksandra Sendecka
+ Aleksi Häkli
+ Alex Dutton
+ Alexander Myodov
+ Alexandr Tatarinov
+ Alex Aktsipetrov
+ Alex Becker
+ Alex Couper
+ Alex Dedul
+ Alex Gaynor
+ Alex Hill
+ Alex Ogier
+ Alex Robbins
+ Alexey Boriskin
+ Alexey Tsivunin
+ Ali Vakilzade
+ Aljaž Košir
+ Aljosa Mohorovic
+ Alokik Vijay
+ Amit Chakradeo
+ Amit Ramon
+ Amit Upadhyay
+ A. Murat Eren
+ Ana Belen Sarabia
+ Ana Krivokapic
+ Andi Albrecht
+ André Ericson
+ Andrei Kulakov
+ Andreas
+ Andreas Mock
+ Andreas Pelme
+ Andrés Torres Marroquín
+ Andrew Brehaut
+ Andrew Clark
+ Andrew Durdin
+ Andrew Godwin
+ Andrew Pinkham
+ Andrews Medina
+ Andrew Northall
+ Andriy Sokolovskiy
+ Andy Chosak
+ Andy Dustman
+ Andy Gayton
+ andy@jadedplanet.net
+ Anssi Kääriäinen
+ ant9000@netwise.it
+ Anthony Briggs
+ Anthony Wright
+ Anton Samarchyan
+ Antoni Aloy
+ Antonio Cavedoni
+ Antonis Christofides
+ Antti Haapala
+ Antti Kaihola
+ Anubhav Joshi
+ Aram Dulyan
+ arien
+ Armin Ronacher
+ Aron Podrigal
+ Arsalan Ghassemi
+ Artem Gnilov
+ Arthur
+ Arthur Jovart
+ Arthur Koziel
+ Arthur Rio
+ Arvis Bickovskis
+ Arya Khaligh
+ Aryeh Leib Taurog
+ A S Alam
+ Asif Saif Uddin
+ atlithorn
+ Audrey Roy
+ av0000@mail.ru
+ Axel Haustant
+ Aymeric Augustin
+ Bahadır Kandemir
+ Baishampayan Ghose
+ Baptiste Mispelon
+ Barry Pederson
+ Bartolome Sanchez Salado
+ Barton Ip
+ Bartosz Grabski
+ Bashar Al-Abdulhadi
+ Bastian Kleineidam
+ Batiste Bieler
+ Batman
+ Batuhan Taskaya
+ Baurzhan Ismagulov
+ Ben Dean Kawamura
+ Ben Firshman
+ Ben Godfrey
+ Benjamin Wohlwend
+ Ben Khoo
+ Ben Slavin
+ Ben Sturmfels
+ Berker Peksag
+ Bernd Schlapsi
+ Bernhard Essl
+ berto
+ Bill Fenner
+ Bjørn Stabell
+ Bo Marchman
+ Bogdan Mateescu
+ Bojan Mihelac
+ Bouke Haarsma
+ Božidar Benko
+ Brad Melin
+ Brandon Chinn
+ Brant Harris
+ Brendan Hayward
+ Brendan Quinn
+ Brenton Simpson
+ Brett Cannon
+ Brett Hoerner
+ Brian Beck
+ Brian Fabian Crain
+ Brian Harring
+ Brian Helba
+ Brian Ray
+ Brian Rosner
+ Bruce Kroeze
+ Bruno Alla
+ Bruno Renié
+ brut.alll@gmail.com
+ Bryan Chow
+ Bryan Veloso
+ bthomas
+ btoll@bestweb.net
+ C8E
+ Caio Ariede
+ Calvin Spealman
+ Cameron Curry
+ Cameron Knight (ckknight)
+ Can Burak Çilingir
+ Can Sarıgöl
+ Carl Meyer
+ Carles Pina i Estany
+ Carlos Eduardo de Paula
+ Carlos Matías de la Torre
+ Carlton Gibson
+ cedric@terramater.net
+ Chad Whitman
+ ChaosKCW
+ Charlie Leifer
+ charly.wilhelm@gmail.com
+ Chason Chaffin
+ Cheng Zhang
+ Chris Adams
+ Chris Beaven
+ Chris Bennett
+ Chris Cahoon
+ Chris Chamberlin
+ Chris Jerdonek
+ Chris Jones
+ Chris Lamb
+ Chris Streeter
+ Christian Barcenas
+ Christian Metts
+ Christian Oudard
+ Christian Tanzer
+ Christoffer Sjöbergsson
+ Christophe Pettus
+ Christopher Adams
+ Christopher Babiak
+ Christopher Lenz
+ Christoph Mędrela
+ Chris Wagner
+ Chris Wesseling
+ Chris Wilson
+ Claude Paroz
+ Clint Ecker
+ colin@owlfish.com
+ Colin Wood
+ Collin Anderson
+ Collin Grady
+ Colton Hicks
+ Craig Blaszczyk
+ crankycoder@gmail.com
+ Curtis Maloney (FunkyBob)
+ dackze+django@gmail.com
+ Dagur Páll Ammendrup
+ Dane Springmeyer
+ Dan Fairs
+ Daniel Alves Barbosa de Oliveira Vaz
+ Daniel Duan
+ Daniele Procida
+ Daniel Fairhead
+ Daniel Greenfeld
+ dAniel hAhler
+ Daniel Jilg
+ Daniel Lindsley
+ Daniel Poelzleithner
+ Daniel Pyrathon
+ Daniel Roseman
+ Daniel Tao
+ Daniel Wiesmann
+ Danilo Bargen
+ Dan Johnson
+ Dan Palmer
+ Dan Poirier
+ Dan Stephenson
+ Dan Watson
+ dave@thebarproject.com
+ David Ascher
+ David Avsajanishvili
+ David Blewett
+ David Brenneman
+ David Cramer
+ David Danier
+ David Eklund
+ David Foster
+ David Gouldin
+ david@kazserve.org
+ David Krauth
+ David Larlet
+ David Reynolds
+ David Sanders
+ David Schein
+ David Tulig
+ David Winterbottom
+ David Wobrock
+ Davide Ceretti
+ Deep L. Sukhwani
+ Deepak Thukral
+ Denis Kuzmichyov
+ Dennis Schwertel
+ Derek Willis
+ Deric Crago
+ deric@monowerks.com
+ Deryck Hodge
+ Dimitris Glezos
+ Dirk Datzert
+ Dirk Eschler
+ Dmitri Fedortchenko
+ Dmitry Jemerov
+ dne@mayonnaise.net
+ Dolan Antenucci
+ Donald Harvey
+ Donald Stufft
+ Don Spaulding
+ Doug Beck
+ Doug Napoleone
+ dready
+ dusk@woofle.net
+ Dustyn Gibson
+ Ed Morley
+ Egidijus Macijauskas
+ eibaan@gmail.com
+ elky
+ Emmanuelle Delescolle
+ Emil Stenström
+ enlight
+ Enrico
+ Eric Boersma
+ Eric Brandwein
+ Eric Floehr
+ Eric Florenzano
+ Eric Holscher
+ Eric Moritz
+ Eric Palakovich Carr
+ Erik Karulf
+ Erik Romijn
+ eriks@win.tue.nl
+ Erwin Junge
+ Esdras Beleza
+ Espen Grindhaug
+ Étienne Beaulé
+ Eugene Lazutkin
+ Evan Grim
+ Fabian Büchler
+ Fabrice Aneche
+ Farhaan Bukhsh
+ favo@exoweb.net
+ fdr
+ Federico Capoano
+ Felipe Lee
+ Filip Noetzel
+ Filip Wasilewski
+ Finn Gruwier Larsen
+ Fiza Ashraf
+ Flávio Juvenal da Silva Junior
+ flavio.curella@gmail.com
+ Florian Apolloner
+ Florian Demmer
+ Florian Moussous
+ Fran Hrženjak
+ Francisco Albarran Cristobal
+ Francisco Couzo
+ François Freitag
+ Frank Tegtmeyer
+ Frank Wierzbicki
+ Frank Wiles
+ František Malina
+ Fraser Nevett
+ Gabriel Grant
+ Gabriel Hurley
+ gandalf@owca.info
+ Garry Lawrence
+ Garry Polley
+ Garth Kidd
+ Gary Wilson
+ Gasper Koren
+ Gasper Zejn
+ Gavin Wahl
+ Ge Hanbin
+ geber@datacollect.com
+ Geert Vanderkelen
+ George Karpenkov
+ George Song
+ George Vilches
+ Georg "Hugo" Bauer
+ Georgi Stanojevski
+ Gerardo Orozco
+ Gil Gonçalves